The layer adds the marker to the div. Therefore, some of the code needs to move into the layer: the marker needs to know how to generate an HTML object that will represent it.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@102 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -12,5 +12,16 @@ OpenLayers.Layer.Marker.prototype =
|
||||
// Implement this. It may not need to do anything usually.
|
||||
moveTo:function(bounds,zoomChanged) {
|
||||
|
||||
}
|
||||
},
|
||||
addMarker:function(marker) {
|
||||
this.markers.append(marker);
|
||||
var resolution = this.map.getResolution();
|
||||
var extent = this.map.getExtent();
|
||||
var pixel = new OpenLayers.Pixel(
|
||||
resolution * (this.lonlat.lon - extent.minlon),
|
||||
resolution * (extent.maxlat - this.lonlat.lat)
|
||||
);
|
||||
var m = marker.generateMarker(pixel);
|
||||
this.div.appendChild(m);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user