From 190d8f4aed3a04072cce7d287f22d67d629b1380 Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Tue, 21 Feb 2012 16:38:59 +0530 Subject: [PATCH 1/2] Add a name to the Vector layer. --- chaloBEST/static/js/editstops.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chaloBEST/static/js/editstops.js b/chaloBEST/static/js/editstops.js index bfe098c..1ca1bf9 100644 --- a/chaloBEST/static/js/editstops.js +++ b/chaloBEST/static/js/editstops.js @@ -150,7 +150,7 @@ var API_BASE = "/1.0/", geojson_format = new OpenLayers.Format.GeoJSON(); //yes, jsonLayer is global. Yes, I know it's wrong. - jsonLayer = layers[1] = new OpenLayers.Layer.Vector({'geometryType': 'Point'}); + jsonLayer = layers[1] = new OpenLayers.Layer.Vector("Bus Stops", {'geometryType': 'Point'}); // map.addLayer(vector_layer); map.addLayers(layers); map.setCenter(center, 12); From 52b552d76ca4d001b7913bba94a0ae30ede2765d Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Tue, 21 Feb 2012 16:51:45 +0530 Subject: [PATCH 2/2] Random shot in the dark, in terms of getting the base map working. --- chaloBEST/static/js/editstops.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/chaloBEST/static/js/editstops.js b/chaloBEST/static/js/editstops.js index 1ca1bf9..de2e5e8 100644 --- a/chaloBEST/static/js/editstops.js +++ b/chaloBEST/static/js/editstops.js @@ -139,18 +139,17 @@ var API_BASE = "/1.0/", function initMap() { var center = new OpenLayers.LonLat(72.855211097628413, 19.010775291486027); - map = new OpenLayers.Map("mapCol", {}); + map = new OpenLayers.Map("mapCol", { + projection: new OpenLayers.Projection("EPSG:900913") + }); var layers = []; // layers[0] = new OpenLayers.Layer.OSM(); - layers[0] = new OpenLayers.Layer.Google( - "Google Streets", // the default - {numZoomLevels: 20, isBaseLayer: true} - ); - + layers[0] = new OpenLayers.Layer.OSM(); geojson_format = new OpenLayers.Format.GeoJSON(); //yes, jsonLayer is global. Yes, I know it's wrong. - jsonLayer = layers[1] = new OpenLayers.Layer.Vector("Bus Stops", {'geometryType': 'Point'}); + jsonLayer = layers[1] = new OpenLayers.Layer.Vector("Bus Stops", { + geometryType: 'Point', projection: new OpenLayers.Projection("EPSG:4326") }); // map.addLayer(vector_layer); map.addLayers(layers); map.setCenter(center, 12);