Hi, Since the release of Leaflet there has been some discussion about passing default settings to a Mapstraction constructor, so that (for example) a tile set can be specified before the instance gets initialised. Has there been any official decision on this? I''ve read that Mapstraction''s stance is that each provider should be required to have a default tile set (which does make sense). But, this means business using mapstraction could incur two sets of fees for tile bandwidth (the default tile set which can''t be switched off, and the new tile set that the developer *actually* wants). Being able to override this default would be a great help Thanks for any info - andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20120401/829eee05/attachment.htm>
Hi Andrew, I use leaflet for mxn here''s how we do it, I don''t believe we load two tilesets var mxn = new mxn.Mapstraction(map_div,''leaflet''); mxn.options.enableDragging = true; mxn.options.scrollWheelZoom = false; mxn.applyOptions(); mxn.setOption({defaultLayer:false}); mxn.addTileLayer( ''http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png'', { attribution: ''Map data © <a href="http://www.openstreetmap. org">OpenStreetMap</a> contributors <a href="http://creativecommons.org/licenses /by-sa/2.0/">CC-BY-SA</a>, Imagery © MapQuest'', subdomains: ''1234'' } ); does this address your situation? 2012/4/1 Andrew Kirwin <andrew.kirwin at gmail.com>:> Hi, > > Since the release of Leaflet there has been some discussion about passing > default settings to a Mapstraction constructor, so that (for example) a tile > set can be specified before the instance gets initialised. > > Has there been any official?decision?on this? I''ve read that Mapstraction''s > stance is that each provider should be required to have a default tile set > (which does make sense). But, this means business using mapstraction could > incur two sets of fees for tile bandwidth (the default tile set which can''t > be switched off, and the new tile set that the developer *actually* wants). > > Being able to override this default would be a great help > > Thanks for any info > - andrew > > > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >
I think Andrew Kirwin is correct. Leaftlet requires a basemap to initialize. In order to keep it matching other providers we recommended having a default load on initialization. That happens internal the new mxn.Mapstraction constructor. You likely won''t see it if your JS runs fast but you would likely see a request for tiles in your Network panel. I agree that we should either extend to provide optional arguments at the end, or even have the constructor optionally take in an Object dictionary and accept creation like: var mxn = new mxn.Mapstraction({div: map_div, provider: ''leaflet'', layers: [''http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png'']} ); any thoughts? Andrew On Sun, Apr 1, 2012 at 3:39 PM, Ed Freyfogle <edf at sloan.mit.edu> wrote:> Hi Andrew, > > I use leaflet for mxn > > here''s how we do it, I don''t believe we load two tilesets > > var mxn = new mxn.Mapstraction(map_div,''leaflet''); > > mxn.options.enableDragging ? = true; > mxn.options.scrollWheelZoom = false; > mxn.applyOptions(); > mxn.setOption({defaultLayer:false}); > mxn.addTileLayer( > ? ? ? ? ? ?''http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png'', > ? ? ? ? ? ?{ > ? ? ? ? ? ? ? ?attribution: ''Map data © <a href="http://www.openstreetmap. > org">OpenStreetMap</a> contributors <a href="http://creativecommons.org/licenses > /by-sa/2.0/">CC-BY-SA</a>, Imagery © MapQuest'', > ? ? ? ? ? ? ? ?subdomains: ''1234'' > ? ? ? ? ? ?} > ? ? ? ?); > > > does this address your situation? > > > 2012/4/1 Andrew Kirwin <andrew.kirwin at gmail.com>: >> Hi, >> >> Since the release of Leaflet there has been some discussion about passing >> default settings to a Mapstraction constructor, so that (for example) a tile >> set can be specified before the instance gets initialised. >> >> Has there been any official?decision?on this? I''ve read that Mapstraction''s >> stance is that each provider should be required to have a default tile set >> (which does make sense). But, this means business using mapstraction could >> incur two sets of fees for tile bandwidth (the default tile set which can''t >> be switched off, and the new tile set that the developer *actually* wants). >> >> Being able to override this default would be a great help >> >> Thanks for any info >> - andrew >> >> >> _______________________________________________ >> Mapstraction mailing list >> Mapstraction at lists.mapstraction.com >> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >> > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com-- Andrew Turner mobile: 248.982.3609 andrew at fortiusone.com http://highearthorbit.com http://geocommons.com? ? ? ? ?? Helping build the Geospatial Web Introduction to Neogeography - http://oreilly.com/catalog/neogeography
see my mail, it doesn''t require a base map to initialize. Why penalize the user with loading a map they don''t plan to see? 2012/4/1 Andrew Turner <andrew at highearthorbit.com>:> I think Andrew Kirwin is correct. Leaftlet requires a basemap to > initialize. In order to keep it matching other providers we > recommended having a default load on initialization. That happens > internal the new mxn.Mapstraction constructor. You likely won''t see it > if your JS runs fast but you would likely see a request for tiles in > your Network panel. > > I agree that we should either extend to provide optional arguments at > the end, or even have the constructor optionally take in an Object > dictionary and accept creation like: > > ?var mxn = new mxn.Mapstraction({div: map_div, provider: ''leaflet'', > layers: [''http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png'']} > ?); > > > any thoughts? > > Andrew > > On Sun, Apr 1, 2012 at 3:39 PM, Ed Freyfogle <edf at sloan.mit.edu> wrote: >> Hi Andrew, >> >> I use leaflet for mxn >> >> here''s how we do it, I don''t believe we load two tilesets >> >> var mxn = new mxn.Mapstraction(map_div,''leaflet''); >> >> mxn.options.enableDragging ? = true; >> mxn.options.scrollWheelZoom = false; >> mxn.applyOptions(); >> mxn.setOption({defaultLayer:false}); >> mxn.addTileLayer( >> ? ? ? ? ? ?''http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png'', >> ? ? ? ? ? ?{ >> ? ? ? ? ? ? ? ?attribution: ''Map data © <a href="http://www.openstreetmap. >> org">OpenStreetMap</a> contributors <a href="http://creativecommons.org/licenses >> /by-sa/2.0/">CC-BY-SA</a>, Imagery © MapQuest'', >> ? ? ? ? ? ? ? ?subdomains: ''1234'' >> ? ? ? ? ? ?} >> ? ? ? ?); >> >> >> does this address your situation? >> >> >> 2012/4/1 Andrew Kirwin <andrew.kirwin at gmail.com>: >>> Hi, >>> >>> Since the release of Leaflet there has been some discussion about passing >>> default settings to a Mapstraction constructor, so that (for example) a tile >>> set can be specified before the instance gets initialised. >>> >>> Has there been any official?decision?on this? I''ve read that Mapstraction''s >>> stance is that each provider should be required to have a default tile set >>> (which does make sense). But, this means business using mapstraction could >>> incur two sets of fees for tile bandwidth (the default tile set which can''t >>> be switched off, and the new tile set that the developer *actually* wants). >>> >>> Being able to override this default would be a great help >>> >>> Thanks for any info >>> - andrew >>> >>> >>> _______________________________________________ >>> Mapstraction mailing list >>> Mapstraction at lists.mapstraction.com >>> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >>> >> _______________________________________________ >> Mapstraction mailing list >> Mapstraction at lists.mapstraction.com >> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > > > > -- > Andrew Turner > mobile: 248.982.3609 > andrew at fortiusone.com > http://highearthorbit.com > > http://geocommons.com? ? ? ? ?? Helping build the Geospatial Web > Introduction to Neogeography - http://oreilly.com/catalog/neogeography > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com
Ed - what I mean is that in the background Mapstraction by default requests tiles, and then the new Tile layer requests tiles over the network. See this screenshot of the Network panel: https://skitch.com/ajturner/8tqfy/double-tiles from Andrew Kirwin''s JS example: http://jsfiddle.net/amk221/mh4Vb/1/ Ideally, we wouldn''t have to have a large object initializer, but the alternative would be to keep extending the explicit parameters. Does anyone else see an issue or solution for the initialization option to specify Tiles (and other parameters)? Andrew On Mon, Apr 2, 2012 at 6:00 AM, Ed Freyfogle <edf at sloan.mit.edu> wrote:> see my mail, it doesn''t require a base map to initialize. > Why penalize the user with loading a map they don''t plan to see? > > > 2012/4/1 Andrew Turner <andrew at highearthorbit.com>: >> I think Andrew Kirwin is correct. Leaftlet requires a basemap to >> initialize. In order to keep it matching other providers we >> recommended having a default load on initialization. That happens >> internal the new mxn.Mapstraction constructor. You likely won''t see it >> if your JS runs fast but you would likely see a request for tiles in >> your Network panel. >> >> I agree that we should either extend to provide optional arguments at >> the end, or even have the constructor optionally take in an Object >> dictionary and accept creation like: >> >> ?var mxn = new mxn.Mapstraction({div: map_div, provider: ''leaflet'', >> layers: [''http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png'']} >> ?); >> >> >> any thoughts? >> >> Andrew >> >> On Sun, Apr 1, 2012 at 3:39 PM, Ed Freyfogle <edf at sloan.mit.edu> wrote: >>> Hi Andrew, >>> >>> I use leaflet for mxn >>> >>> here''s how we do it, I don''t believe we load two tilesets >>> >>> var mxn = new mxn.Mapstraction(map_div,''leaflet''); >>> >>> mxn.options.enableDragging ? = true; >>> mxn.options.scrollWheelZoom = false; >>> mxn.applyOptions(); >>> mxn.setOption({defaultLayer:false}); >>> mxn.addTileLayer( >>> ? ? ? ? ? ?''http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png'', >>> ? ? ? ? ? ?{ >>> ? ? ? ? ? ? ? ?attribution: ''Map data © <a href="http://www.openstreetmap. >>> org">OpenStreetMap</a> contributors <a href="http://creativecommons.org/licenses >>> /by-sa/2.0/">CC-BY-SA</a>, Imagery © MapQuest'', >>> ? ? ? ? ? ? ? ?subdomains: ''1234'' >>> ? ? ? ? ? ?} >>> ? ? ? ?); >>> >>> >>> does this address your situation? >>> >>> >>> 2012/4/1 Andrew Kirwin <andrew.kirwin at gmail.com>: >>>> Hi, >>>> >>>> Since the release of Leaflet there has been some discussion about passing >>>> default settings to a Mapstraction constructor, so that (for example) a tile >>>> set can be specified before the instance gets initialised. >>>> >>>> Has there been any official?decision?on this? I''ve read that Mapstraction''s >>>> stance is that each provider should be required to have a default tile set >>>> (which does make sense). But, this means business using mapstraction could >>>> incur two sets of fees for tile bandwidth (the default tile set which can''t >>>> be switched off, and the new tile set that the developer *actually* wants). >>>> >>>> Being able to override this default would be a great help >>>> >>>> Thanks for any info >>>> - andrew >>>> >>>> >>>> _______________________________________________ >>>> Mapstraction mailing list >>>> Mapstraction at lists.mapstraction.com >>>> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >>>> >>> _______________________________________________ >>> Mapstraction mailing list >>> Mapstraction at lists.mapstraction.com >>> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >> >> >> >> -- >> Andrew Turner >> mobile: 248.982.3609 >> andrew at fortiusone.com >> http://highearthorbit.com >> >> http://geocommons.com? ? ? ? ?? Helping build the Geospatial Web >> Introduction to Neogeography - http://oreilly.com/catalog/neogeography >> _______________________________________________ >> Mapstraction mailing list >> Mapstraction at lists.mapstraction.com >> http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com-- Andrew Turner mobile: 248.982.3609 andrew at fortiusone.com http://highearthorbit.com http://geocommons.com? ? ? ? ?? Helping build the Geospatial Web Introduction to Neogeography - http://oreilly.com/catalog/neogeography
As I said previously, I believe the behaviour of most of the providers is to only load tiles once setCenter has been called for the first time. I think leaflet should mimick this i.e. if no custom tile layer is added by then then load a default. If we go down the road of allowing that stuff to be specified in the constructor it needs to either call in to other Mapstraction methods to do the work or we need to amend the other providers to also support it. Don''t want to get into one set of constructor params for one provider a different set for another provider....that is not an abstraction. Derek On Apr 8, 2012 3:32 AM, "Andrew Turner" <andrew at highearthorbit.com> wrote:> Ed - what I mean is that in the background Mapstraction by default > requests tiles, and then the new Tile layer requests tiles over the > network. > > See this screenshot of the Network panel: > https://skitch.com/ajturner/8tqfy/double-tiles > > from Andrew Kirwin''s JS example: http://jsfiddle.net/amk221/mh4Vb/1/ > > Ideally, we wouldn''t have to have a large object initializer, but the > alternative would be to keep extending the explicit parameters. > > Does anyone else see an issue or solution for the initialization > option to specify Tiles (and other parameters)? > > Andrew > > > On Mon, Apr 2, 2012 at 6:00 AM, Ed Freyfogle <edf at sloan.mit.edu> wrote: > > see my mail, it doesn''t require a base map to initialize. > > Why penalize the user with loading a map they don''t plan to see? > > > > > > 2012/4/1 Andrew Turner <andrew at highearthorbit.com>: > >> I think Andrew Kirwin is correct. Leaftlet requires a basemap to > >> initialize. In order to keep it matching other providers we > >> recommended having a default load on initialization. That happens > >> internal the new mxn.Mapstraction constructor. You likely won''t see it > >> if your JS runs fast but you would likely see a request for tiles in > >> your Network panel. > >> > >> I agree that we should either extend to provide optional arguments at > >> the end, or even have the constructor optionally take in an Object > >> dictionary and accept creation like: > >> > >> var mxn = new mxn.Mapstraction({div: map_div, provider: ''leaflet'', > >> layers: [''http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png'']} > >> ); > >> > >> > >> any thoughts? > >> > >> Andrew > >> > >> On Sun, Apr 1, 2012 at 3:39 PM, Ed Freyfogle <edf at sloan.mit.edu> wrote: > >>> Hi Andrew, > >>> > >>> I use leaflet for mxn > >>> > >>> here''s how we do it, I don''t believe we load two tilesets > >>> > >>> var mxn = new mxn.Mapstraction(map_div,''leaflet''); > >>> > >>> mxn.options.enableDragging = true; > >>> mxn.options.scrollWheelZoom = false; > >>> mxn.applyOptions(); > >>> mxn.setOption({defaultLayer:false}); > >>> mxn.addTileLayer( > >>> ''http://otile{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png > '', > >>> { > >>> attribution: ''Map data © <a href=" > http://www.openstreetmap. > >>> org">OpenStreetMap</a> contributors <a href=" > http://creativecommons.org/licenses > >>> /by-sa/2.0/">CC-BY-SA</a>, Imagery © MapQuest'', > >>> subdomains: ''1234'' > >>> } > >>> ); > >>> > >>> > >>> does this address your situation? > >>> > >>> > >>> 2012/4/1 Andrew Kirwin <andrew.kirwin at gmail.com>: > >>>> Hi, > >>>> > >>>> Since the release of Leaflet there has been some discussion about > passing > >>>> default settings to a Mapstraction constructor, so that (for example) > a tile > >>>> set can be specified before the instance gets initialised. > >>>> > >>>> Has there been any official decision on this? I''ve read that > Mapstraction''s > >>>> stance is that each provider should be required to have a default > tile set > >>>> (which does make sense). But, this means business using mapstraction > could > >>>> incur two sets of fees for tile bandwidth (the default tile set which > can''t > >>>> be switched off, and the new tile set that the developer *actually* > wants). > >>>> > >>>> Being able to override this default would be a great help > >>>> > >>>> Thanks for any info > >>>> - andrew > >>>> > >>>> > >>>> _______________________________________________ > >>>> Mapstraction mailing list > >>>> Mapstraction at lists.mapstraction.com > >>>> > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > >>>> > >>> _______________________________________________ > >>> Mapstraction mailing list > >>> Mapstraction at lists.mapstraction.com > >>> > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > >> > >> > >> > >> -- > >> Andrew Turner > >> mobile: 248.982.3609 > >> andrew at fortiusone.com > >> http://highearthorbit.com > >> > >> http://geocommons.com Helping build the Geospatial Web > >> Introduction to Neogeography - http://oreilly.com/catalog/neogeography > >> _______________________________________________ > >> Mapstraction mailing list > >> Mapstraction at lists.mapstraction.com > >> > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > > _______________________________________________ > > Mapstraction mailing list > > Mapstraction at lists.mapstraction.com > > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > > > > -- > Andrew Turner > mobile: 248.982.3609 > andrew at fortiusone.com > http://highearthorbit.com > > http://geocommons.com Helping build the Geospatial Web > Introduction to Neogeography - http://oreilly.com/catalog/neogeography > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20120410/f24b38db/attachment.htm>