Yermo / nativescript-mapbox

:statue_of_liberty: :tokyo_tower: :mount_fuji: Native OpenGL powered Maps, by Mapbox
MIT License
194 stars 94 forks source link

Marker Clustering #33

Open getmetorajesh opened 8 years ago

getmetorajesh commented 8 years ago

Any plans on implementing the cluster functionality in mapbox

EddyVerbruggen commented 8 years ago

Hi, I'd love to but you're pointing to the JS version whereas this plugin uses the native SDK's. If you can find the clustering feature for native I'd love to hear! Otherwise please ask in the Mapbox GitHub repo, I'm sure they've heard the request before.

EddyVerbruggen commented 7 years ago

Clustering has recently been added to the native SDK (on Android in v 4.2.0) so it's time to look at this again!

EddyVerbruggen commented 7 years ago

2.5.0 has marker clustering on Android, but I couldn't get unclustered markers to show up so it's an undocumented feature for now.

rohanrichards commented 6 years ago

Hey @EddyVerbruggen check out this example. I know it's for the gl.js library, however it does show that they show unclustered markers by adding a second layer.

They use the Filter property to hide it when the point has the point count layer visible (meaning it's been clustered).

Example:

    map.addLayer({
        id: "unclustered-point",
        type: "circle",
        source: "earthquakes",
        filter: ["!has", "point_count"],
        paint: {
            "circle-color": "#11b4da",
            "circle-radius": 4,
            "circle-stroke-width": 1,
            "circle-stroke-color": "#fff"
        }
    });

This is the same approach I used in a project using ngx-mapbox (which is built on mapbox-gl) and it worked well in the browser, perhaps it could work with your native implementation?

keerl commented 6 years ago

It looks like clustering has been added to iOS SDK. Is this a feature that could be looked into again? And possibly documented for Android as well?

https://www.mapbox.com/ios-sdk/maps/examples/clustering/

paul-muckypuddle commented 5 years ago

Agreed, would love to see this in the library!

Codex- commented 5 years ago

Very keen to see this added! Some solid examples around now for both iOS and Android.

Edit: Oh, as said previously, it's already there: https://github.com/EddyVerbruggen/nativescript-mapbox/blob/master/src/mapbox.common.ts#L187

Tyler-V commented 5 years ago

Clustering would be a great addition, from what I can see there aren't any NativeScript plugins that have map clustering / heatmap options for both Android and iOS.

Codex- commented 5 years ago

@Tyler-V You can use this currently ;)

I tested with Android and it seems to work, whether or not it works well in the current version is another question, I've been meaning to look into it more :(

Tyler-V commented 5 years ago

Yes they both implement mapbox.common.ts but only Android currently implements that method, iOS is not available yet.

I was looking to do a mapping project in NativeScript but it appears that there just aren't any mature libraries that meet all of my requirements (heatmap, clustering, offline)

Reached commented 5 years ago

+1 for clustering (IOS/Android) :)

Also I am willing to donate/pay for someone to do this. Unfortunately I am unable to contribute myself on this part :/

Sauvetonbio commented 5 years ago

Hello, any updates to implement clustering on iOS+Android ? We absolutly need it for our project, as we are already using it in our production website... Do you know if it's technically possible to implement it our-self, or something could stop us ?

Example iOS: https://docs.mapbox.com/ios/maps/examples/clustering/ Example Android: https://docs.mapbox.com/android/maps/examples/circle-layer-clustering/

Thank you

mohammadrafigh commented 4 years ago

I'm going to make a PR both for Android and iOS.

sguimont commented 4 years ago

What is missing for the PR to be integrated?

Yermo commented 4 years ago

@sguimont This PR is old from before I took the project over. It needs to be updated to match the v5 changes. I haven't had a chance to look at it yet.

mohammadrafigh commented 4 years ago

I will update PR asap.

sguimont commented 4 years ago

@mohammadrafigh You will make my day! I'm happy to hear someone will continue the work of this feature.

Sauvetonbio commented 4 years ago

I’m still waiting since October too 🙃 thank you !!

Yermo commented 4 years ago

@mohammadrafigh If at all possible, can you make your API match how the equivalent would be done in the Mapbox GL JS API?

What I want to do with this library is make it call compatible with Mapbox GL JS to make porting between web and native. It makes a very compelling use case for adopting NativeScript and this plugin as a solution.

mohammadrafigh commented 4 years ago

@Yermo Actually I'm using nativescript-mapbox and Mapbox GL JS in a shared project (schematics). So using the same API is preferred for me too. For sure I will try to do my best but for now I need to find a workaround for #379 that I faced today when I started to do some investigations. please let me know if you have thoughts about it.

b44rd commented 2 years ago

@mohammadrafigh Did you find a workaround for #379? Would be very nice to see your pull request merged at some point. Let me know if there´s something I can help with in order to make it happen.

Codex- commented 2 years ago

@b44rd the readme advises that the project has now moved: https://github.com/nativescript-community/ui-mapbox