[OpenLayers-Users] Pass an XY coordinate to my marker

Mario Danelli mario.danelli at gmail.com
Mon Dec 17 07:37:03 PST 2012


Dear Brian,

I'm not sure about your question but below you can find some code lines to add a 
marker layer (and icon) to your map.


var layerMarkers = new OpenLayers.Layer.Markers("markers");
map.addLayer(layerMarkers);

var feature = new OpenLayers.Feature.Vector(						
                    new OpenLayers.Geometry.Point(yourLon,yourLat)
                    .transform(fromProjection, toProjection));
layerMarkers.addFeatures(feature);


For a complete example you can follow the example
http://openlayers.org/dev/examples/markers.html

Regards

Mario Danelli
					


	




More information about the Users mailing list