From 447f157fecbce183c06a3fb50f31a189f3f3895a Mon Sep 17 00:00:00 2001 From: Anthony Catel Date: Thu, 8 Oct 2020 17:28:31 +0200 Subject: [PATCH] Fix examples (add reloadHash) --- src/App.vue | 6 +++--- src/components/Map.vue | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index d4ebf47..4591188 100644 --- a/src/App.vue +++ b/src/App.vue @@ -38,9 +38,9 @@

Examples

- Place du Trocadeo - Paris - Place de la République - Tiergatern - Berlin + Place du Trocadeo - Paris + Place de la République + Tiergatern - Berlin
diff --git a/src/components/Map.vue b/src/components/Map.vue index 5a1291a..4c51e76 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -158,6 +158,13 @@ this.$emit('surfaceUpdate', this.surface); }, + reloadHash(hash) { + this.loadHash(hash); + + ["insert_at", "remove_at", "set_at"].forEach(ev => google.maps.event.addListener(this.$poly.getPath(), ev, this.surfaceUpdated)); + this.updatePolygonColor(); + }, + loadHash(hash) { if (hash[0] != 'b') { return this.loadLegacyHash(hash); @@ -192,7 +199,7 @@ loadLegacyHash(hash) { let opt = hash.split(';'); - console.log(opt); + let curPosition = opt.pop(); if (curPosition) {