makinacorpus / Leaflet.TextPath

Show text along Polyline with Leaflet
https://makinacorpus.github.io/Leaflet.TextPath/
MIT License
285 stars 112 forks source link

Not compatible to the new leaflet 1.1.0 (Solved!!!) #56

Closed banmtG closed 7 years ago

banmtG commented 7 years ago

Dear developers,

Could you please update this so that it could be used with the new leaflet.js (1.1.0). It would be soooo great!!!.

Error from console: TypeError: L.Path.prototype._createElement is not a function[Learn More] when I used it with leaflet 1.1.0.

Thanks.

RhinoDevel commented 7 years ago

Did you use the leaflet0.8-dev branch? See README.md.

banmtG commented 7 years ago

Dear RhinoDevel,

Thank you very much for helping me.

I am not so sure how to use both Leaflet 1.1.0 and leaflet0.8-dev branch in one L.map instance. My current web uses leaflet 1.1.0 and its layers and functions (For example: L.tooltip) that were not available in previous leaflet versions.

Maybe you can give me some hints?

All the best,

RhinoDevel commented 7 years ago

Take a look at the source of the demo. Replace <script> and <link> entries in <head> with Leaflet 1.1.0 and Leaflet.TextPath's leaflet0.8-dev. Although it might not work - I haven't tested leaflet0.8-dev with the most recent Leaflet 1.1.0.

banmtG commented 7 years ago

Thanks so muchhhhhh RhinoDevel.

Finally, with your patience and help, I am able to make it work. You saved my life!!!!

For those who are facing the same issue, please follow the steps below:

  1. Download the source code here (leaflet0.8-dev) https://github.com/makinacorpus/Leaflet.TextPath/tree/leaflet0.8-dev.

  2. Copy the leaflet.textpath.js (this is 0.8 dev) at the root folder of the downloaded package to your project.

  3. Include the 0.8 version in your code. In my case, they are: `

    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.1.0/dist/leaflet.css" />
    <script src="js/leaflet.textpath0.8.js"></script>`

So you can use the textpath with leaflet 1.1.0

All credits go to RhinoDevel for his kind instruction.

Good luck to you all!

RhinoDevel commented 7 years ago

@banmtG Please close this issue.