Merge all changes from the naturaldocs sandbox. This brings all the work that
has been done in the NaturalDocs branch back to trunk. Thanks to everyone who helped out in making this happen. (I could list people, but the list would be long, and I'm already mentally on vacation.) git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -4,38 +4,43 @@
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Layer.js
|
||||
* Class: OpenLayers.Layer.Markers
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Layer>
|
||||
*/
|
||||
OpenLayers.Layer.Markers = OpenLayers.Class.create();
|
||||
OpenLayers.Layer.Markers.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Layer, {
|
||||
|
||||
/** Markers layer is never a base layer.
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
isBaseLayer: false,
|
||||
/**
|
||||
* Property: isBaseLayer
|
||||
* {Boolean} Markers layer is never a base layer.
|
||||
*/
|
||||
isBaseLayer: false,
|
||||
|
||||
/** internal marker list
|
||||
* @type Array(OpenLayers.Marker) */
|
||||
markers: null,
|
||||
/**
|
||||
* Property: markers
|
||||
* Array({<OpenLayers.Marker>}) internal marker list
|
||||
*/
|
||||
markers: null,
|
||||
|
||||
|
||||
/** internal state of drawing. This is a workaround for the fact
|
||||
* that the map does not call moveTo with a zoomChanged when the
|
||||
* map is first starting up. This lets us catch the case where we
|
||||
* have *never* drawn the layer, and draw it even if the zoom hasn't
|
||||
* changed.
|
||||
* @type Boolean */
|
||||
drawn: false,
|
||||
/**
|
||||
* Property: drawn
|
||||
* {Boolean} internal state of drawing. This is a workaround for the fact
|
||||
* that the map does not call moveTo with a zoomChanged when the map is
|
||||
* first starting up. This lets us catch the case where we have *never*
|
||||
* drawn the layer, and draw it even if the zoom hasn't changed.
|
||||
*/
|
||||
drawn: false,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor: OpenLayers.Layer.Markers
|
||||
* Create a Markers layer.
|
||||
*
|
||||
* @param {String} name
|
||||
* @param {Object} options Hashtable of extra options to tag onto the layer
|
||||
* Parameters:
|
||||
* name - {String}
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer
|
||||
*/
|
||||
initialize: function(name, options) {
|
||||
OpenLayers.Layer.prototype.initialize.apply(this, arguments);
|
||||
@@ -43,7 +48,7 @@ OpenLayers.Layer.Markers.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
this.clearMarkers();
|
||||
@@ -53,9 +58,12 @@ OpenLayers.Layer.Markers.prototype =
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} zoomChanged
|
||||
* @param {Boolean} dragging
|
||||
* Method: moveTo
|
||||
*
|
||||
* Parameters:
|
||||
* bounds - {<OpenLayers.Bounds>}
|
||||
* zoomChanged - {Boolean}
|
||||
* dragging - {Boolean}
|
||||
*/
|
||||
moveTo:function(bounds, zoomChanged, dragging) {
|
||||
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
|
||||
@@ -67,7 +75,10 @@ OpenLayers.Layer.Markers.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Marker} marker
|
||||
* Method: addMarker
|
||||
*
|
||||
* Parameters:
|
||||
* marker - {<OpenLayers.Marker>}
|
||||
*/
|
||||
addMarker: function(marker) {
|
||||
this.markers.push(marker);
|
||||
@@ -78,7 +89,10 @@ OpenLayers.Layer.Markers.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Marker} marker
|
||||
* Method: removeMarker
|
||||
*
|
||||
* Parameters:
|
||||
* marker - {<OpenLayers.Marker>}
|
||||
*/
|
||||
removeMarker: function(marker) {
|
||||
OpenLayers.Util.removeItem(this.markers, marker);
|
||||
@@ -89,7 +103,7 @@ OpenLayers.Layer.Markers.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: clearMarkers
|
||||
*/
|
||||
clearMarkers: function() {
|
||||
if (this.markers != null) {
|
||||
@@ -99,7 +113,9 @@ OpenLayers.Layer.Markers.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/** clear all the marker div's from the layer and then redraw all of them.
|
||||
/**
|
||||
* Method: redraw
|
||||
* clear all the marker div's from the layer and then redraw all of them.
|
||||
* Use the map to recalculate new placement of markers.
|
||||
*/
|
||||
redraw: function() {
|
||||
@@ -108,12 +124,13 @@ OpenLayers.Layer.Markers.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/** Calculate the pixel location for the marker, create it, and
|
||||
/**
|
||||
* Method: drawMarker
|
||||
* *Private*. Calculate the pixel location for the marker, create it, and
|
||||
* add it to the layer's div
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param {OpenLayers.Marker} marker
|
||||
*
|
||||
* Parameters:
|
||||
* marker - {<OpenLayers.Marker>}
|
||||
*/
|
||||
drawMarker: function(marker) {
|
||||
var px = this.map.getLayerPxFromLonLat(marker.lonlat);
|
||||
|
||||
Reference in New Issue
Block a user