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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user