Marker and projection

3 messages Options
Embed this post
Permalink
Daniel Degasperi

Marker and projection

Reply Threaded More More options
Print post
Permalink
Hi,
is there any plan to integrate the reprojection in "Marker"?
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
  [hidden email]
 
---------------------------
  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
[hidden email]
http://openlayers.org/mailman/listinfo/users
Christopher Schmidt-2

Re: Marker and projection

Reply Threaded More More options
Print post
Permalink
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
>   [hidden email]
>  
> ---------------------------
>   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
> [hidden email]
> http://openlayers.org/mailman/listinfo/users

--
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users
Roald de Wit-2

Re: Marker and projection

Reply Threaded More More options
Print post
Permalink
In reply to this post by Daniel Degasperi
Daniel,

It is better to use Layer.Vector instead. You can style vector layers to
have icons too. If you manually add points to a Vector layer, you'd
still need to reproject yourself (IIRC).

Regards, Roald

Daniel Degasperi wrote:

> Hi,
> is there any plan to integrate the reprojection in "Marker"?
> 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
>
>  

_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users