[OpenLayers-Users] Marker and projection

Christopher Schmidt crschmidt at metacarta.com
Wed Nov 4 09:27:19 EST 2009


On Wed, Nov 04, 2009 at 01:56:18PM +0100, Daniel Degasperi wrote:
> Hi,
> is there any plan to integrate the reprojection in "Marker"?

Nope.

-- Chris

> In this moment I've to transform my point ("EPSG:4326") manually to 
> "EPSG:900913",
> create a LatLon-Object and pass it trough the constructor of the "Marker".
> 
> Example:
>     proj4326 = new OpenLayers.Projection("EPSG:4326");
>     proj900913 = new OpenLayers.Projection("EPSG:900913");
>     pt = new OpenLayers.Geometry.Point(11.3307484,46.4825565);
>     pt = OpenLayers.Projection.transform(pt, proj4326, proj900913);
>     var ll = new OpenLayers.LonLat(pt.x,pt.y);
>    
>     // marker info
>     var icon = new 
> OpenLayers.Icon('http://openlayers.org/dev/img/marker-gold.png', size);
>     var data = {'icon': icon};
>     var feature = new OpenLayers.Feature(layer_marker, ll, data);
> 
> Best regards
> Daniel
> 
> -- 
>   Daniel Degasperi
>   Software Developer
>   daniel.degasperi at r3-gis.com
>   
> ---------------------------
>   R3 GIS Srl
>   Via Johann Kravogl 2
>   I-39010 Merano - Sinigo (BZ)
>   Tel. +39 0473 494949
>   Fax. +39 0473 069902
>   Web  http://www.r3-gis.com
> -----------------------------
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list