From aa7b68e18a644c375d8e03e11eea67f8d6d54e49 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Fri, 14 Dec 2018 13:31:36 +0100 Subject: [PATCH] Create tag.map --- tag.map | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tag.map diff --git a/tag.map b/tag.map new file mode 100644 index 0000000..819134e --- /dev/null +++ b/tag.map @@ -0,0 +1,29 @@ + + + + + // Variables + this.items = opts.items + this.address = opts.address + this.region = opts.region + this.delay = opts.delay + this.urlMap = '' + let that = this + + // Get lat and log + axios.get(`https://nominatim.openstreetmap.org/search?q=${this.address},${this.region}&format=json`) + .then(function (response) { + let lat = response.data[0].lat + let lon = response.data[0].lon + let boundingbox = response.data[0].boundingbox + // Show map + that.urlMap = `https://www.openstreetmap.org/export/embed.html?bbox=${boundingbox[2]}%2C${boundingbox[0]}%2C${boundingbox[3]}%2C${boundingbox[1]}&layer=mapnik&marker=${lat}%2C${lon}` + // Update iframe + that.update() + }) + .catch(function (error) { + // handle error + console.log(error) + }) + +