-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.js
More file actions
18 lines (17 loc) · 993 Bytes
/
map.js
File metadata and controls
18 lines (17 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const mapjs = {
version: 1,
google: function(place, width, heigth) {
if (typeof width === 'undefined') { width = '600'; }
if (typeof heigth === 'undefined') { heigth = '450'; }
var googlemap = document.createElement("div");
googlemap.innerHTML = '<iframe width="' + width + '" height="' + heigth + '" style="border:0" loading="lazy" allowfullscreen src="https://www.google.com/maps/embed/v1/place?key=AIzaSyC7HAr3ww-RvJii8vmOMTU6RNV8O0AQ8TE&q=' + place + '"></iframe>';
document.body.appendChild(googlemap);
},
waze: function(lat, long, width, heigth) {
if (typeof width === 'undefined') { width = '600'; }
if (typeof heigth === 'undefined') { heigth = '450'; }
var wazemap = document.createElement("div");
wazemap.innerHTML = '<iframe src="https://embed.waze.com/iframe?zoom=12&lat=' + lat +'&lon=' + long +'" width="' + width +'" height="' + heigth + '"></iframe>';
document.body.appendChild(wazemap);
}
};