JSDOC / coding standards for Marker Layer
git-svn-id: http://svn.openlayers.org/trunk/openlayers@124 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -1,29 +1,50 @@
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
OpenLayers.Layer.Marker = Class.create();
|
||||
OpenLayers.Layer.Marker.prototype =
|
||||
Object.extend( new OpenLayers.Layer(), {
|
||||
|
||||
// markers: store internal marker list
|
||||
/** internal marker list
|
||||
* @type Array(OpenLayers.Marker) */
|
||||
markers: [],
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} name
|
||||
*/
|
||||
initialize: function(name) {
|
||||
OpenLayers.Layer.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
// Implement this. It may not need to do anything usually.
|
||||
moveTo: function(bounds,zoomChanged) {
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} zoomChanged
|
||||
*/
|
||||
// HACK HACK Implement this. It may not need to do anything usually.
|
||||
moveTo: function(bounds, zoomChanged) {
|
||||
if (zoomChanged) {
|
||||
this.div.innerHTML="";
|
||||
this.div.innerHTML = "";
|
||||
for(i=0; i < this.markers.length; i++) {
|
||||
this.drawMarker(this.markers[i]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Marker} marker
|
||||
*/
|
||||
addMarker: function(marker) {
|
||||
this.markers.append(marker);
|
||||
if (this.map && this.map.getExtent()) {
|
||||
this.drawMarker(marker);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Marker} marker
|
||||
*/
|
||||
drawMarker: function(marker) {
|
||||
var resolution = this.map.getResolution();
|
||||
var extent = this.map.getExtent();
|
||||
@@ -33,5 +54,8 @@ OpenLayers.Layer.Marker.prototype =
|
||||
);
|
||||
var m = marker.generateMarker(pixel);
|
||||
this.div.appendChild(m);
|
||||
}
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.Marker"
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user