hugobarragon / leaflet-drift-marker

A marker that can drift its way to a new position
MIT License
28 stars 9 forks source link

leaflet-drift-marker does not work with react-leaflet v3 #5

Closed MariosPalazis closed 3 years ago

MariosPalazis commented 3 years ago

I follow the demo instructions with react hooks but I got the error TypeError: Object prototype may only be an Object or null: undefined. Or some times couldnt read "lat". I attach some snippets er2 er3 er1

hugobarragon commented 3 years ago

@MariosPalazis list the versions you are using please
but your import should be as the documentacion show import { DriftMarker } from "leaflet-drift-marker" create a code sandobox link to replicate the bugm use the demo link to replicate

MariosPalazis commented 3 years ago

"core-js": "^3.9.1", "leaflet": "^1.7.1", "leaflet-drift-marker": "^1.0.3", "react": "^17.0.1", "react-dom": "^16.14.0", "react-leaflet": "^3.1.0", "react-leaflet-animated-marker": "^1.0.2",

I did it like this: import { DriftMarker } from "leaflet-drift-marker" ..same error

hugobarragon commented 3 years ago

ok you are using react-leaflet new version 3.x its not supported as stated on documentation only previous non hooks version 2.x is supported or now

https://github.com/hugobarragon/leaflet-drift-marker/blob/master/README.md

hugobarragon commented 3 years ago

READ WITH ATENTION

This Repo will only create the leaflet pure class, to use with leaflet, and for other frameworks to use, such as react,vue,angular.... this wil

for react usage it will be created a react-leaflet-drift-marker that will integrate leaflet-drift-marker

with this we can split features and make bundle size smaller for every framework and user needs

hugobarragon commented 3 years ago

Moved to https://github.com/hugobarragon/react-leaflet-drift-marker

hugobarragon commented 3 years ago

react-leaflet-drift-marker v3 will support react-leaflet v3