While writing up the example for Andy on ''offline'' maps I implemented toggleTileLayer in OpenLayers. Combined with the merge request for Leaflet it''s clear that it''s time to think a little bit about changing the ''layer management'' in Mapstraction. Historically, there were very few options. It was really just Google''s 3: Road, Satellite, Hybrid; and then OpenStreetMap''s default and possibly NASA Blue Marble. Today it''s a very different landscape (get it? landscape, basemaps...) where there are a plethora of basemaps and layers that can be added. I think there are a few basic principles that Mapstraction should hold to: * Initialization and operation of the map is completely independent of the provider. Changing the provider shouldn''t require adding additional code to set a center or a tile layer for one map when it''s not required for another map. * Users should get ''sensible defaults''. Where they can create a map as simply as possible with no looking up complicated parameters or URL''s. However, we should also want to enable the slightly more advanced developer to override these defaults easily when creating their maps while still retaining independence of the provider for Mapstraction supported functionality. A couple of things I''d specifically like to change, but wanted to get feedback from others. So please chime in if this is a good idea or bad idea. 1 - Key off of a ''layer name'' rather than the URL as the key. Currently when you add a layer with a URL you then must use the URL for toggling or removing. It may make it slightly easier to change to the name. 2 - Make Mapstraction.ROAD et al. just references to a Name like any other tile layer. Core would provide default Road, Satellite, Terrain (as possible, OpenAerialMap isn''t ready yet AFAIK). Individual provides could override these (e.g. Google Maps). There would be nothing particularly special about them other than if unspecified the Road layer will be loaded when the map is created. 3 - Provide a options object to the initialization method where users can set defaults. This would allow a user at map creation time to set things like Center & Zoom, basemap tile layer, controls, etc. rather than having to wait until after map instantiation would have created defaults which will then just be changed which would have loaded in tiles or made controls visible that were necessary. We wouldn''t want to get crazy with configuration complexity (ala OpenLayers) but still allow developers to specify defaults before we set them as necessary within the provider. The alternative is to recommend the basic recipe of always: create map, setCenterAndZoom, addTileLayer(Road) - regardless of the provider so that it''s easy for them to switch later. Anyways, just some thoughts as I dive back into the code. Andrew -- 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