mirror of
https://github.com/weewx/weewx.git
synced 2026-04-24 19:47:08 -04:00
35 lines
912 B
HTML
35 lines
912 B
HTML
## map module for standard skin
|
|
## Copyright Tom Keffer, Matthew Wall
|
|
## See LICENSE.txt for your rights
|
|
#errorCatcher Echo
|
|
|
|
#if $Extras.has_key('google_map_apikey')
|
|
<div id='map_widget' class="widget">
|
|
<div class="widget_title">
|
|
Location
|
|
<a class="widget_control"
|
|
onclick="toggle_widget('map')">♦</a>
|
|
</div>
|
|
<div class="widget_contents">
|
|
<div id='map_canvas'"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function init_map() {
|
|
var latlng = {lat: $station.latitude_f, lng: $station.longitude_f};
|
|
var map = new google.maps.Map(document.getElementById("map_canvas"), {
|
|
zoom: 8,
|
|
center: latlng
|
|
});
|
|
var marker = new google.maps.Marker({
|
|
position: latlng,
|
|
map: map,
|
|
title: "$station.location"
|
|
});
|
|
}
|
|
</script>
|
|
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=${Extras.google_map_apikey}&callback=init_map" async defer>
|
|
</script>
|
|
#end if
|