arthur-e / Wicket

A modest library for moving between Well-Known Text (WKT) and various framework geometries
https://arthur-e.github.io/Wicket/
Other
586 stars 226 forks source link

vuejs with leaflet(1.6.0) error says wkt.fromObject is not a function #147

Open ryuchaehwa opened 4 years ago

ryuchaehwa commented 4 years ago

Hello, I have a problem that wkt.fromObject() methods which doesn't work in vuejs web. I've checked other issues below(google api issue) but i'm using leaflet and I'm not sure how to fix it. Please check below and advise me.

package.json

"wicket": "^1.3.6"
"leaflet": "^1.6.0",
"terraformer": "^1.0.6",
"terraformer-wkt-parser": "^1.1.2",

code

if (layer instanceof L.LinkPolyline) {

          let geometry = wkt.fromObject(layer.toGeoJSON().geometry).write()
}

p.s I'm converting vanilla leaflet.js to vuejs framework at the moment. This code works in our original vanilla js project with leaflet 1.0.6 but with npm installed, it just doesn't work. Also, If I import the module like this

import * as wkt from 'wicket' 

wicket__WEBPACK_IMPORTED_MODULE_21__.fromObject is not a function

there's another error so I'm importing it like this: let wkt = require('wicket')

Regards,