AW: [OpenLayers-Users] MARKER IN GOOGLE LAYER

Arnd Wippermann arnd.wippermann at web.de
Thu Feb 17 13:21:18 EST 2011


You have to reproject your points from EPSG:4326 to EPSG:900913. For this
two projections it's possible with OpenLayers.

P4326   = new OpenLayers.Projection("EPSG:4326");
P900913 = new OpenLayers.Projection("EPSG:900913");

pt900913 = new OpenLayers.LonLat(78.4752,17.3785).transform(P4326, P900913);
markers.addMarker(new OpenLayers.Marker(pt900913),icon);

I would also suggest, that you add your markers layer after you have added
your baselayer to the map.

map.addLayers([gmap, gsat, yahoosat, wms,mysore]);
...
map.addLayer(markers);

Arnd

-----Ursprüngliche Nachricht-----
Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von davidraja.d
Gesendet: Donnerstag, 17. Februar 2011 13:56
An: users at openlayers.org
Betreff: [OpenLayers-Users] MARKER IN GOOGLE LAYER


HI Friends,
    I need one urgent help.Google Layer is my base layer. i added one wms
layer from geoserver.
now i want to add some points over the the map using lat & lon.So i tried to
add marker.But that is not coming at the correct place.it is coming at some
different place.I think because of differnt projecton system.But i add the
marker in kml layer example(example in openlayers"kml-layer.html") it is
coming at correct position.
But the base layer is not google.

   Now i have some lat long values. i have to show on the map.Just tell if
you know another way to solve this.
  
  Here i have attached my code.Kindly help me to solve this.

Thanks in advance.

Regarts,
David.
http://osgeo-org.1803224.n2.nabble.com/file/n6035794/AP.html AP.html
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Apply-thematic-in-WMS-layer-using-too
-long-sld-tp5815413p6035794.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list