Add working code for Markers -- marker layer and marker object. Also add markers.html to demo use of markers functionality.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@107 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-17 17:21:57 +00:00
parent efbd12fc29
commit 4d0f98f4fe
3 changed files with 64 additions and 9 deletions

View File

@@ -28,8 +28,15 @@ OpenLayers.Marker.prototype = {
this.lonlat = lonlat;
},
generateMarker: function(pixel) {
var markerObject;
// Create a div here, and set the location to the pixel above
// Create a div here, and set the location to the pixel above modified
// by the icon size.
var markerObject = OpenLayers.Util.createImage(
this.icon.url,
this.icon.size,
new OpenLayers.Pixel(
pixel.x-(this.icon.size.w/2),
pixel.y-this.icon.size.h)
);
return markerObject;
}
}