From aashish.chaudhary at kitware.com Wed Oct 28 09:15:07 2015 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 28 Oct 2015 09:15:07 -0400 Subject: [Geojs-users] GeoJS supporting tiles from multiple sub domains In-Reply-To: References: Message-ID: There is. Please have a look at https://github.com/OpenGeoscience/geojs/blob/master/src/core/osmLayer.js line 167 (tileUrl) API. Let me know how it goes. - Aashish On Wed, Oct 28, 2015 at 5:04 AM, Madhav Sharan wrote: > Hi Dan/Aashish, > > I was trying different base maps for GeoParser and most of the tile layers > I came across support multiple subdomains. I tried using {s} notation in > GeoJS too but that didn't worked out so I hardcoded it to one of the > domains. Just curious if there is an alternative to achieve it? > > http://a.basemaps.cartocdn.com/light_all > > From https://cartodb.com/basemaps/ : > > new ol.layer.Tile({ > source: new ol.source.XYZ({ > url: 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png ', > attributions: [new ol.Attribution({ html: ['© OpenStreetMap contributors, © CartoDB'] })] > }) > }) > > -- > Thanks > Madhav Sharan > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: From aashish.chaudhary at kitware.com Wed Oct 28 18:55:49 2015 From: aashish.chaudhary at kitware.com (Aashish Chaudhary) Date: Wed, 28 Oct 2015 18:55:49 -0400 Subject: [Geojs-users] GeoJS supporting tiles from multiple sub domains In-Reply-To: References: Message-ID: Make sure to pass the baseUrl argument to osmLayer as well (see below). if (arg && arg.baseUrl !== undefined) { m_baseUrl = arg.baseUrl; } On Wed, Oct 28, 2015 at 6:51 PM, Madhav Sharan wrote: > HI Aashish, Using tileUrl API I am able to handle "// " part > but this was also working with "baseUrl". I am trying to focus the {s} part, > in other map APIs {s} gets replaced with a,b,c etc.. > > tileUrl : 'http://{s}.basemaps.cartocdn.com/light_all///.png' > > -- > Thanks > Madhav Sharan > > > On Wed, Oct 28, 2015 at 6:15 AM, Aashish Chaudhary < > aashish.chaudhary at kitware.com> wrote: > >> There is. Please have a look at >> https://github.com/OpenGeoscience/geojs/blob/master/src/core/osmLayer.js >> line 167 (tileUrl) API. >> >> Let me know how it goes. >> >> - Aashish >> >> On Wed, Oct 28, 2015 at 5:04 AM, Madhav Sharan wrote: >> >>> Hi Dan/Aashish, >>> >>> I was trying different base maps for GeoParser and most of the tile >>> layers I came across support multiple subdomains. I tried using {s} >>> notation in GeoJS too but that didn't worked out so I hardcoded it to one >>> of the domains. Just curious if there is an alternative to achieve it? >>> >>> http://a.basemaps.cartocdn.com/light_all >>> >>> From https://cartodb.com/basemaps/ : >>> >>> new ol.layer.Tile({ >>> source: new ol.source.XYZ({ >>> url: 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png ', >>> attributions: [new ol.Attribution({ html: ['© OpenStreetMap contributors, © CartoDB'] })] >>> }) >>> }) >>> >>> -- >>> Thanks >>> Madhav Sharan >>> >>> >> >> >> -- >> >> >> >> *| Aashish Chaudhary | Technical Leader | Kitware Inc. >> * >> *| http://www.kitware.com/company/team/chaudhary.html >> * >> > > -- *| Aashish Chaudhary | Technical Leader | Kitware Inc. * *| http://www.kitware.com/company/team/chaudhary.html * -------------- next part -------------- An HTML attachment was scrubbed... URL: