Stop using deprecated Layer.GML in examples
This commit is contained in:
+14
-15
@@ -50,21 +50,20 @@
|
||||
|
||||
style.addRules([rule, elseRule]);
|
||||
|
||||
// Create a GML layer with GeoRSS format and a style map.
|
||||
markerLayer = new OpenLayers.Layer.GML("Some images from Flickr",
|
||||
"xml/georss-flickr.xml", {
|
||||
format: OpenLayers.Format.GeoRSS,
|
||||
formatOptions: {
|
||||
// adds the thumbnail attribute to the feature
|
||||
createFeatureFromItem: function(item) {
|
||||
var feature = OpenLayers.Format.GeoRSS.prototype
|
||||
.createFeatureFromItem.apply(this, arguments);
|
||||
feature.attributes.thumbnail =
|
||||
this.getElementsByTagNameNS(
|
||||
item, "*", "thumbnail")[0].getAttribute("url");
|
||||
return feature;
|
||||
}
|
||||
},
|
||||
// Create a Vector layer with GeoRSS format and a style map.
|
||||
markerLayer = new OpenLayers.Layer.Vector("Some images from Flickr", {
|
||||
protocol: new OpenLayers.Protocol.HTTP({
|
||||
url: "xml/georss-flickr.xml",
|
||||
format: new OpenLayers.Format.GeoRSS({
|
||||
// adds the thumbnail attribute to the feature
|
||||
createFeatureFromItem: function(item) {
|
||||
var feature = OpenLayers.Format.GeoRSS.prototype.createFeatureFromItem.apply(this, arguments);
|
||||
feature.attributes.thumbnail = this.getElementsByTagNameNS(item, "*", "thumbnail")[0].getAttribute("url");
|
||||
return feature;
|
||||
}
|
||||
})
|
||||
}),
|
||||
strategies: [new OpenLayers.Strategy.Fixed()],
|
||||
// Giving the style map keys for "default" and "select"
|
||||
// rendering intent, to make the image larger when selected
|
||||
styleMap: new OpenLayers.StyleMap({
|
||||
|
||||
Reference in New Issue
Block a user