diff options
author | Andreas Jakum <aj-gh@users.noreply.github.com> | 2018-06-24 08:26:13 +0200 |
---|---|---|
committer | Andreas Jakum <aj-gh@users.noreply.github.com> | 2018-06-24 08:26:13 +0200 |
commit | ef000811a02c1c672254319df303b09b9338f889 (patch) | |
tree | 865f061bbf89c69db3bec505005d1355247bc413 | |
parent | 57419ab8a580d512fc6d68de5f1e6b302a209680 (diff) | |
parent | 062c056eef6acee3e33967efc0095ceeb8b07624 (diff) |
Merge branch 'master' into stable
-rw-r--r-- | map.js | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -21,19 +21,41 @@ debug = function (log_txt) { function initialize(lat, lng, res) { debug("Initializing Funkfeuer Graz Map"); + var OSM_Mapnik = 'OSM_Mapnik'; + var copyrightNode = document.createElement('div'); + copyrightNode.id = 'copyright-control'; + copyrightNode.style.fontSize = '11px'; + copyrightNode.style.fontFamily = 'Arial, sans-serif'; + copyrightNode.style.margin = '0 2px 2px 0'; + copyrightNode.style.whitespace = 'nowrap'; + copyrightNode.innerHTML = 'Map data © <a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> / Google'; + copyrightNode.index = 0; + google.maps.visualRefresh=true; var mapOptions = { center: new google.maps.LatLng(lat, lng), zoom: res, streetViewControl: false, disableDoubleClickZoom: true, - mapTypeId: google.maps.MapTypeId.ROADMAP, + mapTypeId: OSM_Mapnik, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID, - google.maps.MapTypeId.SATELLITE , google.maps.MapTypeId.TERRAIN ], + google.maps.MapTypeId.SATELLITE , google.maps.MapTypeId.TERRAIN, + OSM_Mapnik ], style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, } }; map = new google.maps.Map(document.getElementById("map"), mapOptions); + map.mapTypes.set("OSM_Mapnik", new google.maps.ImageMapType({ + getTileUrl: function(coord, zoom) { + return "//tile.openstreetmap.org/" + zoom + "/" + coord.x + "/" + coord.y + ".png"; + }, + tileSize: new google.maps.Size(256, 256), + name: "OpenStreetMap", + maxZoom: 18 + })); + + map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(copyrightNode); + //##// map.addControl(new RulerControl()); var reloadconDiv = document.createElement('div'); |