source: t29-www/shared/js-v6/pagescripts/impressum.js @ 1489

Last change on this file since 1489 was 1489, checked in by sven, 7 months ago

Impressum: Google-Maps-Karte

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1/**
2 * technikum29 OpenStreetMapss / Leaflet maps widget
3 * Successor of the Google Maps widget from 2009-2018.
4 * Installed by Sven at 2019-01-12
5 *
6 * Requires the Leaflet scripts/css available, cf. https://leafletjs.com/download.html
7 **/
8
9var t29_gmaps_content = {
10        "de": "<b>technikum29</b><br/>Am Flachsland 29<br/>Kelkheim/Taunus"
11                        +"<br/><a href='http://maps.google.com/maps?&daddr=Am+Flachsland+29,+Kelkheim&layer=&sll=50.092393,10.195313&sspn=38.370164,57.392578&ie=UTF8&z=16&om=1&iwloc=addr'>Route berechnen...</a>",
12        "en": "<b>technikum29</b><br/>Close to Frankfurt/Main<br/>Germany"
13};
14
15
16var t29_maps_center = {
17        // map.setCenter(new GLatLng( .. , .. ), .. )
18        // so [     xpos/lat        ,      ypos        ]
19        "de": [50.08005710712455, 8.510284423828125],
20        "en": [51.6452940493054,  8.173828125      ]
21};
22
23var t29_maps_zoom = { "de": 11, "en": 5 };
24
25// Position of museum
26var t29_maps_pos = [ 50.14522,8.44604 ];
27
28
29function t29_gmaps_detect_page_language() {
30        // try to detect page language by heading
31        return t29.conf.lang;
32}
33
34$(function() {
35        var lang = t29_gmaps_detect_page_language();
36        var map = L.map('map').setView(t29_maps_center[lang], t29_maps_zoom[lang]);
37        if(t29) t29.map = map; // save back for debugging
38
39        L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
40            attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
41        }).addTo(map);
42
43        L.marker(t29_maps_pos).addTo(map)
44            .bindPopup(t29_gmaps_content[lang])
45            .openPopup();
46});
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License