diff options
-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'); |