Add docs clarifying that you should clone() before passing icons into the

marker constructor.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@3782 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-07-22 13:59:24 +00:00
parent b5e0c3ba61
commit 4b752fbe5c

View File

@@ -23,8 +23,14 @@
* var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
* var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',size,offset);
* markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,0),icon));
* markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,0),icon.clone()));
*
* (end)
*
* Note that if you pass an icon into the Marker constructor, it will take
* that icon and use it. This means that you should not share icons between
* markers -- you use them once, but you should clone() for any additional
* markers using that same icon.
*/
OpenLayers.Marker = OpenLayers.Class({