hubertokf/vue2-leaflet-draw

draw:created not firing when moving to production

Opened this issue · 0 comments

I've been having trouble getting drawn polygon's geojson in production. When I run the app locally, draw:created fires and I can see the geojson in my requests. Here's the code:

const map = this.$refs.map.$refs.map;

map.mapObject.on("draw:created", (e) => {
      this.searchPolygon = e.layer.toGeoJSON();
    });
map.mapObject.on("draw:deleted", (e) => {
      this.searchPolygon = {};
    });

However, for some reason when running it in production, no geojson makes it into 'searchPolygon' after drawing a shape on the map. I'm running the same Docker image of my frontend locally and in production. I can see the mapObject in both environments too, I've run out of ideas of where to look.