mirror of
https://github.com/owntracks/recorder.git
synced 2024-11-15 09:58:40 -07:00
add apikey to map
This commit is contained in:
parent
834530a1f5
commit
b8325f49de
@ -3,7 +3,7 @@
|
||||
|
||||
// https://developers.google.com/maps/documentation/javascript/datalayer
|
||||
|
||||
var infowindow = new google.maps.InfoWindow();
|
||||
var infowindow;
|
||||
|
||||
function processPoints(geometry, callback, thisArg) {
|
||||
if (geometry instanceof google.maps.LatLng) {
|
||||
@ -22,6 +22,8 @@ function initialize() {
|
||||
var map;
|
||||
var center = new google.maps.LatLng( 46.993665, 10.399188);
|
||||
|
||||
infowindow = new google.maps.InfoWindow();
|
||||
|
||||
mapOptions = {
|
||||
center: center,
|
||||
zoom: 5,
|
||||
@ -92,5 +94,3 @@ function initialize() {
|
||||
infowindow.open(map);
|
||||
});
|
||||
}
|
||||
|
||||
google.maps.event.addDomListener(window, 'load', initialize);
|
||||
|
@ -16,10 +16,27 @@
|
||||
body { font-size: 80%; padding: 0; margin: 0px; }
|
||||
|
||||
</style>
|
||||
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
|
||||
|
||||
<script src="../static/js/mustache.js"></script>
|
||||
<script src="../static/js/moment.min.js"></script>
|
||||
<script src="functions.js"></script>
|
||||
<script src="../static/apikey.js"></script>
|
||||
<script>
|
||||
function loadMapsAPI() {
|
||||
var script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.src = 'https://maps.googleapis.com/maps/api/js?v=3' +
|
||||
'&signed_in=true&key=' + apiKey +'&callback=initialize';
|
||||
document.body.appendChild(script);
|
||||
|
||||
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
loadMapsAPI();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map-canvas"></div>
|
||||
|
Loading…
Reference in New Issue
Block a user