manubb / Leaflet.PixiOverlay

Bring Pixi.js power to Leaflet maps
MIT License
463 stars 85 forks source link

rescaling issues #5

Closed sgentile closed 6 years ago

sgentile commented 6 years ago

Both in your demo's and locally, the way the icons are positioned at times do not match their location. ie. you can easily see markers in the water at zoom levels - as you zoom closer they are back on land where they belong.

Is this something you are going to fix ?

manubb commented 6 years ago

I am not sure i understand the issue you are reporting. In demos on US and french cities, i use an algorithm that avoids marker overlaps and at lower zoom levels, the fact that marker are not at their precise location is expected. Can you post a screenshot displaying your problem?

sgentile commented 6 years ago

that explains it - I would like to disable that so that it's on the right latlng, ie. precision for what I need is more important than overlay at higher zoom levels.

what would you recommend I change to enable that ?

Thanks!

sgentile commented 6 years ago

Each of these represent the final city in the last image - as you can see, it's not even close until zoomed in . - If somone was wanting to know where the city was, in the first example they would way off.

On Nov 4, 2017 7:45 PM, "Manuel Baclet" notifications@github.com wrote:

I am not sure i understand the issue you are reporting. In demos on US and french cities, i use an algorithm that avoids marker overlaps and at lower zoom levels, the fact that marker are not at their precise location is expected. Can you post a screenshot displaying your problem?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/manubb/Leaflet.PixiOverlay/issues/5#issuecomment-341938266, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIFNO8ECLCf4mUw6aGi6FsPycRt5EHRks5szPcjgaJpZM4QSK2l .

manubb commented 6 years ago

Here is a simplified version of us-cities demo: https://manubb.github.io/Leaflet.PixiOverlay/us-cities-simple.html that you can use as a base for what you want to do.

Note that the feature we are talking of is not a part of the main library ;-)

sgentile commented 6 years ago

Thanks Manuel - I'll check it out!

Appreciate your response

On Sun, Nov 5, 2017 at 12:05 PM, Manuel Baclet notifications@github.com wrote:

Here is a simplified version of us-cities demo: https://manubb.github.io/Leaflet.PixiOverlay/us-cities-simple.html that you can use as a base for what you want to do.

Note that the feature we are talking of is not a part of the main library ;-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/manubb/Leaflet.PixiOverlay/issues/5#issuecomment-341988318, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIFNFmhkqdWFWeSn7aqDtQgsxewyiqLks5szerTgaJpZM4QSK2l .

sgentile commented 6 years ago

That is exactly what I'm looking for!

What is your recommendation then for selection ?

I was thinking when an item is selected, return back all the markers at that point. What is your thought on that ?

On Sun, Nov 5, 2017 at 12:05 PM, Manuel Baclet notifications@github.com wrote:

Here is a simplified version of us-cities demo: https://manubb.github.io/Leaflet.PixiOverlay/us-cities-simple.html that you can use as a base for what you want to do.

Note that the feature we are talking of is not a part of the main library ;-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/manubb/Leaflet.PixiOverlay/issues/5#issuecomment-341988318, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIFNFmhkqdWFWeSn7aqDtQgsxewyiqLks5szerTgaJpZM4QSK2l .

sgentile commented 6 years ago

another thing I notice with this - the load time is significantly faster

On Sun, Nov 5, 2017 at 12:05 PM, Manuel Baclet notifications@github.com wrote:

Here is a simplified version of us-cities demo: https://manubb.github.io/Leaflet.PixiOverlay/us-cities-simple.html that you can use as a base for what you want to do.

Note that the feature we are talking of is not a part of the main library ;-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/manubb/Leaflet.PixiOverlay/issues/5#issuecomment-341988318, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIFNFmhkqdWFWeSn7aqDtQgsxewyiqLks5szerTgaJpZM4QSK2l .

manubb commented 6 years ago

Concerning selection, i cannot recommend anything as this is really app specific.

If the number of markers is small, you can simply use Pixi.js interactivity.

If you want to display many markers you can have a look at the code of us-cities demo to see how interactivity is implemented. (I am using quadtrees to find which marker(s) is(are) under the click or under the pointer. Since markers are static in your project, the code would be much simpler and you only need to use one quadtree.)

manubb commented 6 years ago

I'm gonna close this. Reopen if you need to.

sgentile commented 6 years ago

Thanks again for your help - I put a sample together for anyone else interested in trying this:

https://github.com/sgentile/PixieOverlaySample