Added intermediate step when parsing GeoJSON to have access to future attributes...
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 18 Aug 2013 21:20:12 +0000 (21:20 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 18 Aug 2013 21:20:12 +0000 (21:20 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1524 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrmap.js

index 2850541a00354ce92a8d81caefee89c3a70d2858..22209e04fd81308afcf12ef78ab9e4d3c2ddc4f4 100644 (file)
--- a/wrmap.js
+++ b/wrmap.js
@@ -12,8 +12,10 @@ function init_wrmap(i, jq_map) {
        var EPSG4326 = new OpenLayers.Projection("EPSG:4326"); // lon/lat 
        var EPSG3857 = new OpenLayers.Projection("EPSG:3857"); // google
        var POINT_NAME = {'sledrun': 'Rodelbahn', 'inn': 'Gasthaus', 'busstop': 'Haltestelle', 'carpark': 'Parkplatz', 'attention': 'Achtung', 'point': 'Punkt'};
-       var format_json = new OpenLayers.Format.GeoJSON();
-       var features_all = format_json.read(json_string);
+       var format_json = new OpenLayers.Format.JSON();
+       var json_js = format_json.read(json_string);
+       var format_geojson = new OpenLayers.Format.GeoJSON();
+       var features_all = format_geojson.read(json_js);
        var features_path = new Array();
        var features_point = new Array();
        for (var i = 0; i != features_all.length; ++i) {