[OpenLayers-Users] Markers

Andre Pereira de Matos andre.matos at co.sapo.pt
Tue Jan 13 06:19:14 EST 2009


You can add markers using a vector layer like this:

markersLayer = new OpenLayers.Layer.Vector("Markers",
                                                                        {
                                                                        projection: new OpenLayers.Projection("EPSG:4326"),
                                                                        styleMap: new OpenLayers.StyleMap({
                                                                                        externalGraphic: "http://openlayers.org/dev/img/marker-gold.png",
                                                                                        backgroundGraphic: "http://openlayers.org/dev/examples/marker_shadow.png"
                                                                                        graphicYOffset: -20,
                                                                                        backgroundXOffset: 0,
                                                                                backgroundYOffset: -17,
                                                                                        pointRadius: 10
                                                                                })
                                                                        }
                                                );

map.addLayer(markersLayer);
feature1 = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(-1904105.3415234375, 4392319.753066596));
markersLayer.addFeatures([feature1]);

Regards,
André Matos
http://mapas.sapo.pt


-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On Behalf Of Derek Watling
Sent: terça-feira, 13 de Janeiro de 2009 10:52
To: users at openlayers.org
Subject: [OpenLayers-Users] Markers


Any good references on adding markers in OpenLayers? I have tried in the past
with no success and am now at a point where I need them.
--
View this message in context: http://n2.nabble.com/Markers-tp2150609p2150609.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list