kothic / kothic-js

Kothic JS — a full-featured JavaScript map rendering engine using HTML5 Canvas
http://kothic.org
BSD 2-Clause "Simplified" License
451 stars 46 forks source link

Add compatibility with Leaflet 1.0 #65

Closed DerDakon closed 4 years ago

DerDakon commented 8 years ago

The first things I encountered were TileLayer.Canvas and _reset(), which are not in 1.0 anymore.

braandl commented 7 years ago

I have ported kothic to Leaflet 1.0.X, I can provide a Patch propably next week if you want.

DerDakon commented 7 years ago

Yes please!

braandl commented 7 years ago

I am sorry, I totally forgot about this.

Since I have made alot of changes I could not simply create a patch out of my current version, but I did put the required changes into the kothic-leaflet.jsj for you. Basicly all it needs is to push throught the "done" method and execute with the filled canvas in the end.

Hope this helps!

kothic-leaflet-1-0.zip

DerDakon commented 7 years ago

Ok, I looked a bit into this. Looks like you removed the support for tiles in .js files, but only half of it. From me looking at it _scripts can now entirely be removed. The removal could be the first commit.

Then there is drawTileWithUrl(), which is not used inside the module (needed as callback for Leaflet?).

And the rest could be the final commit, and then become a PR. @mourner, any further thoughts?

braandl commented 7 years ago

I did clean the sources and updated the example and put it all together in a pull-request for you! I did test it with the local test-tile.js. It now loads all the same tile into any position on the demo, because I don't have a public geo-json tile server, but the idea is clear.

I hope this helps!

DerDakon commented 7 years ago

You could try http://tiles.openrailwaymap.org/vector/ as base URI.

braandl commented 7 years ago

You can put whatever URI you want. The user will need to put an own source anyways. The example works perfectly.

nickw1 commented 4 years ago

Closed, see PRs #70 and #73.