From: philipp Date: Sun, 18 Aug 2013 21:20:12 +0000 (+0000) Subject: Added intermediate step when parsing GeoJSON to have access to future attributes... X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/mediawiki_extensions/wrmap.git/commitdiff_plain/148633d03dbc4a15afd4e21ded56dc7ad92dcbd8?hp=ddd7f9433e9294a009859de7b7b02b70a4857cd8 Added intermediate step when parsing GeoJSON to have access to future attributes of the FeatureCollection. git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1524 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- diff --git a/wrmap.js b/wrmap.js index 2850541..22209e0 100644 --- 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) {