geoman-io / leaflet-geoman

πŸ‚πŸ—ΊοΈ The most powerful leaflet plugin for drawing and editing geometry layers
https://geoman.io
MIT License
2.21k stars 433 forks source link

Uncaught TypeError: _this.map.pm.setLang is not a function #430

Closed vodnicearv closed 5 years ago

vodnicearv commented 5 years ago

I use leaflet.pm in Nuxt application:

mounted () {
      if (process.client) {
        const checkMapObject = setInterval(() => {
          if (this.$refs.map) {
            this.map = this.$refs.map.mapObject
            this.map.pm.addControls({
              position: 'topleft',
              drawCircle: false
            })
            this.map.pm.setLang('de')
         }, 100)
      }
    }

and in browser console get error: Screenshot_1

https://github.com/codeofsumit/leaflet.pm/issues/376

codeofsumit commented 5 years ago

setLang is not released yet. Will be in the next release in a few days/weeks

zled commented 5 years ago

I have the same problem on june,27,2019 with leaflet.pm 2.1.0 version . I can see setLang function inside leaflet.pm.min.js but then in chrome dev. tools ... Uncaught TypeError: map.pm.setLang is not a function at initMap (protoSigafEdit.aspx:1432).
I have no include statement for the language json files and didn't find examples.

codeofsumit commented 5 years ago

@zled please provide a jsfiddle showing this Problem Dominican debug and help you out πŸ‘