give WFS a featureClass and have it be set in the constructor
git-svn-id: http://svn.openlayers.org/trunk/openlayers@406 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -8,6 +8,9 @@ OpenLayers.Layer.WFS.prototype =
|
|||||||
Object.extend(new OpenLayers.Layer.Grid(),
|
Object.extend(new OpenLayers.Layer.Grid(),
|
||||||
Object.extend(new OpenLayers.Layer.Markers(), {
|
Object.extend(new OpenLayers.Layer.Markers(), {
|
||||||
|
|
||||||
|
/** @type Object */
|
||||||
|
featureClass: null,
|
||||||
|
|
||||||
/** @final @type hash */
|
/** @final @type hash */
|
||||||
DEFAULT_PARAMS: { service: "WFS",
|
DEFAULT_PARAMS: { service: "WFS",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
@@ -21,10 +24,15 @@ OpenLayers.Layer.WFS.prototype =
|
|||||||
* @param {str} name
|
* @param {str} name
|
||||||
* @param {str} url
|
* @param {str} url
|
||||||
* @param {hash} params
|
* @param {hash} params
|
||||||
|
* @param {Object} featureClass
|
||||||
*/
|
*/
|
||||||
initialize: function(name, url, params) {
|
initialize: function(name, url, params, featureClass) {
|
||||||
OpenLayers.Layer.Grid.prototype.initialize.apply(this, arguments);
|
this.featureClass = featureClass;
|
||||||
OpenLayers.Layer.Markers.prototype.initialize.apply(this, arguments);
|
|
||||||
|
var newArguments = new Array(name, url, params);
|
||||||
|
OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments);
|
||||||
|
OpenLayers.Layer.Markers.prototype.initialize.apply(this, newArguments);
|
||||||
|
|
||||||
OpenLayers.Util.applyDefaults(this.params, this.DEFAULT_PARAMS);
|
OpenLayers.Util.applyDefaults(this.params, this.DEFAULT_PARAMS);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ OpenLayers.Tile.WFS.prototype =
|
|||||||
|
|
||||||
for (var i=0; i < resultFeatures.length; i++) {
|
for (var i=0; i < resultFeatures.length; i++) {
|
||||||
|
|
||||||
var feature = new MCFeature(resultFeatures[i]);
|
var feature = new this.layer.featureClass(resultFeatures[i]);
|
||||||
var icon = new OpenLayers.Icon(feature.markerImage, feature.size);
|
var icon = new OpenLayers.Icon(feature.markerImage, feature.size);
|
||||||
var marker = new OpenLayers.Marker(feature.lonlat, icon, feature);
|
var marker = new OpenLayers.Marker(feature.lonlat, icon, feature);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user