diff options
| -rw-r--r-- | chimere/static/chimere/js/jquery.chimere.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js index a4b1321..0af3f47 100644 --- a/chimere/static/chimere/js/jquery.chimere.js +++ b/chimere/static/chimere/js/jquery.chimere.js @@ -983,6 +983,20 @@ OpenLayers.Layer.MapQuestOSM = OpenLayers.Class(OpenLayers.Layer.XYZ, { cleanRoute: function(){ settings.layerVectors.removeAllFeatures(); }, + // add json layer + addJSON: function(json_url){ + settings.layerJson = new OpenLayers.Layer.Vector("GeoJSON", { + projection: EPSG_PROJECTION, + strategies: [new OpenLayers.Strategy.Fixed()], + protocol: new OpenLayers.Protocol.HTTP({ + url: json_url, + format: new OpenLayers.Format.GeoJSON() + }) + }); + settings.map.addLayer(settings.layerJson); + settings.map.zoomToExtent(settings.layerJson.getDataExtent()); + // settings.layerJson.setOpacity(0.5); + }, // Put a route on the map addRoute: function(route) { var polyline = route.geometry; |
