From 3307f4202308279b724a3122849cc73279f3b291 Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Wed, 22 Feb 2012 04:26:19 -0800 Subject: [PATCH] Add Bing imagery (chalobest@hotmail.com) to editstops.js. --- README | 1 + chaloBEST/static/js/editstops.js | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README b/README index 2c1ef06..985b44d 100644 --- a/README +++ b/README @@ -1,5 +1,6 @@ Note: If running postgres 9.1 and Django < 1.4, you will probably need this patch for things to work: https://code.djangoproject.com/raw-attachment/ticket/16778/postgis-adapter-2.patch . Reasons are explained here: http://stackoverflow.com/questions/7667724/error-saving-geodjango-pointfield +Don't forget to install python-psycopg2 and python-gdal for the sake of GeoDjango. chaloBEST diff --git a/chaloBEST/static/js/editstops.js b/chaloBEST/static/js/editstops.js index 6233314..c796c5b 100644 --- a/chaloBEST/static/js/editstops.js +++ b/chaloBEST/static/js/editstops.js @@ -226,13 +226,14 @@ var API_BASE = "/1.0/", // layers[0] = new OpenLayers.Layer.OSM(); layers[0] = new OpenLayers.Layer.OSM(); + layers[1] = new OpenLayers.Layer.Bing({ + name: "Bing Aerial", + type: "Aerial", + key: "AqGpO7N9ioFw3YHoPV3C8crGfJqW5YST4gGKgIOnijrUbitLlgcAS2A0M9SJrUv9", + }); 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' -// projection: new OpenLayers.Projection("EPSG:4326") - }); - // map.addLayer(vector_layer); + jsonLayer = layers[2] = new OpenLayers.Layer.Vector("Bus Stops"); map.addLayers(layers); map.setCenter(center, 12); var navigationControl = new OpenLayers.Control.Navigation({ @@ -269,16 +270,16 @@ var API_BASE = "/1.0/", } }); map.addControl(navigationControl); - mapControl = new OpenLayers.Control.SelectFeature(layers[1], { + mapControl = new OpenLayers.Control.SelectFeature(jsonLayer, { clickout: false, toggle: true }); - zoomControl = new OpenLayers.Control.ZoomToMaxExtent(); + map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(mapControl); // map.addControl(zoomControl); mapControl.activate(); // zoomControl.activate(); - layers[1].events.on({ + jsonLayer.events.on({ 'featureselected': onFeatureSelect, 'featureunselected': onFeatureUnselect });