[fusion-dev] Markers in Openlayers.

Paul Deschamps pdeschamps at dmsolutions.ca
Mon Jun 9 15:13:46 EDT 2008


Hi All,

Want your two cents on the prospect on adding  the
"OpenLayers.Layer.Markers" class  into
trunk/lib//lib/OpenLayers/OpenLayers.js

Adding a markers layer is quite easy as long as that class is loaded
(obviously ;)

Here's a very basic implementation of adding a OL marker in a Fusion app.

function addMarker(iLon,iLat){

    // get the map and map widget
    var mapWidget = Fusion.getMapById('mapArea');
    var maps = mapWidget.getAllMaps();
    var map = maps[0];

    // create a markers layer called "Markers"
    var markers = new OpenLayers.Layer.Markers( "Markers" );

    // add the marker layer to the OL Map.
    mapWidget.oMapOL.addLayer(markers);

    // OL Image related stuff.
    var size = new OpenLayers.Size(10,17);
    var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
    var icon = new OpenLayers.Icon('
http://boston.openguides.org/markers/AQUA.png',size,offset);

    // add the marker.
    markers.addMarker(new OpenLayers.Marker(new
OpenLayers.LonLat(iLon,iLat),icon));
}

Do we want to add the OpenLayers.Layer.Markers class in 1.1?

Cheers

Paul D.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fusion-dev/attachments/20080609/d953d784/attachment.html


More information about the fusion-dev mailing list