summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/hierfehltwas.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/hierfehltwas.js')
-rw-r--r--app/assets/javascripts/hierfehltwas.js67
1 files changed, 67 insertions, 0 deletions
diff --git a/app/assets/javascripts/hierfehltwas.js b/app/assets/javascripts/hierfehltwas.js
new file mode 100644
index 0000000..96dcfe7
--- /dev/null
+++ b/app/assets/javascripts/hierfehltwas.js
@@ -0,0 +1,67 @@
+var map;
+var ajaxRequest;
+var plotlist;
+var plotlayers=[];
+
+
+window.onDomReady = initReady;
+window.onDomReady(initmap);
+
+function initReady(fn) {
+ if(document.addEventListener) {
+ document.addEventListener("DOMContentLoaded", fn, false);
+ }
+}
+
+
+function initmap() {
+ // set up the map
+ map = new L.Map('map');
+
+ // create the tile layer with correct attribution
+ //var osmUrl='http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png';
+ var osmUrl='http://otile1.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png';
+ //var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
+ var osmAttrib='Data, imagery and map information provided by MapQuest, OpenStreetMap <http://www.openstreetmap.org/copyright> and contributors, ODbL <http://wiki.openstreetmap.org/wiki/Legal_FAQ#I_would_like_to_use_OpenStreetMap_maps._How_should_I_credit_you.#> .'
+ var osm = new L.TileLayer(osmUrl, {minZoom: 12, maxZoom: 18, attribution: osmAttrib});
+
+ map.setView(new L.LatLng(51.335, 12.37),14);
+ map.addLayer(osm);
+ //L.marker([51.33, 12.35], {icon: hfw1Icon}).addTo(map);
+ //L.marker([51.37, 12.33], {icon: hfw2Icon}).addTo(map);
+ //L.marker([51.31, 12.31], {icon: hfw3Icon}).addTo(map);
+
+}
+
+var hfw1Icon = L.icon({
+ iconUrl: 'images/new-hfw-marker.png',
+ shadowUrl: 'images/hfw-marker-shadow.png',
+
+ iconSize: [50, 80], // size of the icon
+ shadowSize: [50, 74], // size of the shadow
+ iconAnchor: [25, 80], // point of the icon which will correspond to marker's location
+ shadowAnchor: [25, 60], // the same for the shadow
+ popupAnchor: [0, 74] // point from which the popup should open relative to the iconAnchor
+});
+
+var hfw2Icon = L.icon({
+ iconUrl: 'images/hfw-puzzle.png',
+ shadowUrl: 'images/hfw-marker-shadow.png',
+
+ iconSize: [50, 80], // size of the icon
+ shadowSize: [50, 74], // size of the shadow
+ iconAnchor: [25, 80], // point of the icon which will correspond to marker's location
+ shadowAnchor: [25, 60], // the same for the shadow
+ popupAnchor: [0, 74] // point from which the popup should open relative to the iconAnchor
+});
+
+var hfw3Icon = L.icon({
+ iconUrl: 'images/hfw-marker.png',
+ shadowUrl: 'images/hfw-marker-shadow.png',
+
+ iconSize: [50, 74], // size of the icon
+ shadowSize: [50, 74], // size of the shadow
+ iconAnchor: [25, 54], // point of the icon which will correspond to marker's location
+ shadowAnchor: [25, 54], // the same for the shadow
+ popupAnchor: [0, 74] // point from which the popup should open relative to the iconAnchor
+});