From 8b9e3fc59c8043cf353a7e1e28e827ad90d4b6f0 Mon Sep 17 00:00:00 2001 From: expoonserver Date: Fri, 29 Apr 2016 03:32:52 +0100 Subject: [PATCH] Remove old commented broken code Use local resources for markers and openlayers --- map/index.html | 52 +++++++++++++------------------------------------- 1 file changed, 13 insertions(+), 39 deletions(-) diff --git a/map/index.html b/map/index.html index b0e627354..05cb15428 100644 --- a/map/index.html +++ b/map/index.html @@ -7,7 +7,7 @@ - + @@ -17,12 +17,12 @@ // Position and Zoomlevel of the map var lon = 13.8081; var lat = 47.6776; -var zoom = 14; +var zoom = 12; var map; var showPopupOnHover = true; -text = new Array("Show map information","Hide map information"); +text = new Array("Show instructions","Hide instructions"); function drawmap() { OpenLayers.Lang.setCode('en'); @@ -43,31 +43,12 @@ function drawmap() { displayProjection: new OpenLayers.Projection("EPSG:4326") } ); -// Display the control elements -//map.addControl(new OpenLayers.Control.PanZoomBar()); -//map.addControl(new OpenLayers.Control.Permalink('permalink')); -//map.addControl(new OpenLayers.Control.ScaleLine()); -//map.addControl(new OpenLayers.Control.LayerSwitcher()); - -//checkForPermalink(); icons = new Array(); -icons[0] = new Array('http://openlayers.org/api/img/marker.png','21','25','0.5','1'); +icons[0] = new Array('/javascript/openlayers/img/marker.png','21','25','0.5','1'); // Display layers -//layer_markers = new OpenLayers.Layer.Markers("Marker", { projection: new OpenLayers.Projection("EPSG:4326"),visibility: true, displayInLayerSwitcher: false }); -//layer_vectors = new OpenLayers.Layer.Vector("Zeichnungen", { displayInLayerSwitcher: true } ); -//map.addLayer(layer_vectors); -//map.addLayer(layer_markers) -//layers = new Array(); -//layer_layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik"); -//map.addLayer(layer_layerMapnik); -//layers.push(new Array(layer_layerMapnik,'layer_layerMapnik')); -//layer_layerCyclemap = new OpenLayers.Layer.OSM.CycleMap("Cyclemap"); -//map.addLayer(layer_layerCyclemap); -//layers.push(new Array(layer_layerCyclemap,'layer_layerCyclemap')); - layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik"); map.addLayer(layerMapnik); @@ -94,23 +75,22 @@ var gpxStyles = new OpenLayers.StyleMap({ "default": new OpenLayers.Style({ pointRadius: "5", // sized according to type attribute graphicName: "star", - label: "${name}", + label: "${name}", labelAlign: "rb", - //labelAlign: "${align}", + //labelAlign: "${align}", //labelXOffset: "${xOffset}", //labelYOffset: "${yOffset}", labelOutlineColor: "white", labelOutlineWidth: 3, - fontSize: 12, + fontSize: 12, fontFamily: "Arial", fontColor: "brown", labelYOffset: 10, fillColor: "black", - - - strokeColor: "red", + + strokeColor: "red", strokeWidth: 3, strokeOpacity: 0.8 }), @@ -137,7 +117,7 @@ var layerGPX = new OpenLayers.Layer.Vector("Entrances", { map.addLayer(layerGPX); layers.push(new Array(layerGPX,'layerGPX')); - // fit map to bounds of window and add start, finish pins (finish not working) +// fit map to bounds of window and add start, finish pins (finish not working) layerGPX.events.register("loadend", layerGPX, function() { this.map.zoomToExtent(this.getDataExtent()); //var startPoint = this.features[0].geometry.components[0]; @@ -157,15 +137,8 @@ layers.push(new Array(layerMarkers,'layerMarkers')); setLayer(1); -// Jump to the right location -jumpTo(lon,lat,zoom); -// Display marker icons -//icons = new Array(); -//icons[0] = new Array('http://openlayers.org/api/img/marker.png','21','25','0.5','1'); -//icons[4] = new Array('http://osmtools.de/easymap/images/pin_red.png','16','28','0','1'); -//icons[6] = new Array('http://osmtools.de/easymap/images/pin_green.png','16','28','0','1'); -//icons[10] = new Array('http://osmtools.de/easymap/images/haus_red.png','20','24','0.5','0.5'); + // Display markers addMarker(layerMarkers,13.8248,47.6884,"Stone Bridge

Not the real stone bridge: this is a demo",false,0); @@ -173,6 +146,7 @@ addMarker(layerMarkers,13.8248,47.6884,"Stone Bridge

Not the real sto geometries = new Array(); // Nochmal was.. +map.setCenter(0, zoom, 1, 1); jumpTo(lon, lat, zoom); toggleInfo(); checkUtilVersion(4); @@ -202,7 +176,7 @@ body { --> -

Show map information
+
Show instructions
Expo prototype slippy map
Please mouseover
the pin markers.

If you see this text, you opened the map HTML-File without the necessary files.