[OpenLayers-Dev] Markers reprojection

Christopher Schmidt crschmidt at metacarta.com
Mon Apr 21 16:41:41 EDT 2008


On Mon, Apr 21, 2008 at 03:03:45PM -0400, Julien-Samuel Lacroix wrote:
> 
> Christopher Schmidt wrote:
> > In general, there is no good place that we can know that we should be
> > reprojecting on these layers. 
>  >
> > Where do you think the reprojection code would live in this case? I
> > don't like the idea of touching someone else's geometry. In the case of
> > a Layer.GML or some such, the format is creating the geometry, so it
> > never belonged to someone else to begin with, but with Layer.Vector and
> > Layer.Marker, that's less true.
> 
> I'm not sure about the vector layers, but the markers could be 
> reprojected in the addMarker function:
> 
> addMarker: function(marker) {
>          if(this.projection != this.map.projection)
>          {
>              marker.lonlat.transform(this.projection, this.map.projection);
>          }
> ...
> 
> 
> What do you think? Is there other uses of this class where this wouldn't 
> work?

WFS, Text, and GeoRSS layers already reproject markers before they get
to the addMarker call.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list