On 17 September 2010 12:33, Eric Lemoine <eric.lemo...@camptocamp.com> wrote: > a projection. But, to be able to support > > new OpenLayers.Map({ > div: "map", > layers: new OpenLayers.Layer.Google() > center: [0, 0] > }); > > we could introduce a kind of fallback mechanism, where the map gets > the projection from the first layer (the one at index 0 in the layers > array) when it has no projection itself.
this seems contradictory to me. On the one hand, you're saying that all layers are equal, but then you're saying the first layer somehow has priority - so all layers are equal, but some are more equal than others :-) I agree that it would be better to make things more flexible, and not make the baselayer/overlay distinction compulsory. But this distinction is surely useful, and ISTM that getting rid of it is going too far the other way. It's surely a common use case that people want to display some vectors over a fixed raster like Google. The raster layer is only available in a limited number of projections/resolutions, and the vectors have to adapt themselves to that. So in this case the raster layer not the vector layer has to determine the map projection/resolution. These 2 layers are not equal, and I don't see the point in pretending they are. This is implicit in your example above, but would it not be better to make it explicit by distinguishing between the base/master/inflexible/whateverothername layer and the overlay/flexible/whateverothername one? Having said that, I agree that it would be nice to be able to combine different layers with different projections in the same map, and be able to toggle between them. For example, a walking route map in the Pyrenees could enable the user to look at the French map in the French projection for French sections, and to switch to the Spanish map/projection for the Spanish sections. (It would also be a good tutorial on how different projections represent the earth in different ways.) On the subject of layers, it would be nice to have a distinction between source/server and OL layers. Google for example has several different layers, and it would be nice to be able to set these up in a layerswitcher control and allow the user to change between them without the programmer having to set up a separate OL layer for each one. The same applies to WMS servers, where it's common to have different layers for road, rail, river etc. It would simplify things if the programmer could just define 1 OL layer for this, and then have the layerswitcher determine the LAYERS parameter. (Ok, I know this can be done at the moment with custom code, but it would be nice if it could be simple to set up.) Another point about vectors would be that a vector source too might be available in several different projections. Depending on circumstances, it might be better to fetch the file in the new projection if available rather than rely on the appropriate transformation logic (proj or whatever) being present for those particular projections. So a way to specify this layer as supporting projections a and b, otherwise use transform(). As the EPSG has now set up a code for 'Google Mercator' (3857), ISTM it would be better to use that and remove the fictitious 900913. Also, get rid of the 'spherical mercator' param, which is inherent in the projection and should not need to be specially defined. _______________________________________________ Dev mailing list d...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-dev