Single argument constructor for UTFGrid layer.
This commit is contained in:
@@ -19,9 +19,10 @@
|
||||
* Example:
|
||||
*
|
||||
* (start code)
|
||||
* var world_utfgrid = new OpenLayers.Layer.UTFGrid(
|
||||
* 'UTFGrid Layer',
|
||||
* "http://tiles/world_utfgrid/${z}/${x}/${y}.json"
|
||||
* var world_utfgrid = new OpenLayers.Layer.UTFGrid({
|
||||
* url: "/tiles/world_utfgrid/${z}/${x}/${y}.json",
|
||||
* utfgridResolution: 4,
|
||||
* displayInLayerSwitcher: false
|
||||
* );
|
||||
* map.addLayer(world_utfgrid);
|
||||
*
|
||||
@@ -99,14 +100,18 @@ OpenLayers.Layer.UTFGrid = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Layer.UTFGrid
|
||||
* Create a new UTFGrid layer.
|
||||
*
|
||||
* Parameters:
|
||||
* name - {String}
|
||||
* url - {String}
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer
|
||||
* config - {Object} Configuration properties for the layer.
|
||||
*
|
||||
* Required configuration properties:
|
||||
* url - {String} The url template for UTFGrid tiles. See the <url> property.
|
||||
*/
|
||||
initialize: function(name, url, options) {
|
||||
OpenLayers.Layer.Grid.prototype.initialize.apply(this, [name, url, {}, options]);
|
||||
initialize: function(options) {
|
||||
OpenLayers.Layer.Grid.prototype.initialize.apply(
|
||||
this, [options.name, options.url, {}, options]
|
||||
);
|
||||
this.tileOptions = OpenLayers.Util.extend({
|
||||
utfgridResolution: this.utfgridResolution
|
||||
}, this.tileOptions);
|
||||
@@ -117,20 +122,17 @@ OpenLayers.Layer.UTFGrid = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
* Create a clone of this layer
|
||||
*
|
||||
* Parameters:
|
||||
* obj - {Object} Is this ever used?
|
||||
* obj - {Object} Only used by a subclass of this layer.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Layer.UTFGrid>} An exact clone of this OpenLayers.Layer.UTFGrid
|
||||
*/
|
||||
clone: function (obj) {
|
||||
|
||||
if (obj == null) {
|
||||
obj = new OpenLayers.Layer.UTFGrid(this.name,
|
||||
this.url,
|
||||
this.getOptions());
|
||||
obj = new OpenLayers.Layer.UTFGrid(this.getOptions());
|
||||
}
|
||||
|
||||
//get all additions from superclasses
|
||||
// get all additions from superclasses
|
||||
obj = OpenLayers.Layer.Grid.prototype.clone.apply(this, [obj]);
|
||||
|
||||
return obj;
|
||||
|
||||
Reference in New Issue
Block a user