makinacorpus / Leaflet.MeasureControl

Leaflet control to mesure distances on the map
https://makinacorpus.github.io/Leaflet.MeasureControl
BSD 3-Clause "New" or "Revised" License
82 stars 48 forks source link

undefined use in vue #28

Open haoxl3 opened 5 years ago

haoxl3 commented 5 years ago
require('leaflet');
require('leaflet.measurecontrol');
mounted() {
     this.$nextTick(() => {
          this.map = this.$refs.map.mapObject;
          L.Control.measureControl().addTo(this.map);
    }
}

I got L.Control.measureControl is not a function

lj1002094787 commented 5 years ago

解决了吗 我也遇到这个问题

Google Translatation: « Résolu? J'ai aussi rencontré ce problème. »

haoxl3 commented 5 years ago

解决了吗 我也遇到这个问题

没有,我已经不记得为什么用这个了,刚看了下我代码,没有它

Google Translatation: « Non, je ne me souviens plus pourquoi j'ai utilisé cela, je viens de voir mon code, non. »

mabhub commented 5 years ago

You're issue seems to be related to VueJS environment global variable management and not to this plugin. Could you try to reproduce your problem in a shared code environment like https://codesandbox.io/ or https://jsfiddle.net/ ? So we can try to find a solution.

Also, please use english for any issue or comment.