nativescript-mapbox icon indicating copy to clipboard operation
nativescript-mapbox copied to clipboard

Marker Clustering

Open getmetorajesh opened this issue 7 years ago • 22 comments

Any plans on implementing the cluster functionality in mapbox

getmetorajesh avatar Sep 09 '16 02:09 getmetorajesh

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 avatar Sep 09 '16 12:09 EddyVerbruggen

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 avatar Jan 28 '17 16:01 EddyVerbruggen

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.

EddyVerbruggen avatar Jan 29 '17 20:01 EddyVerbruggen

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?

rohanrichards avatar May 15 '18 01:05 rohanrichards

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/

keerl avatar Jul 29 '18 22:07 keerl

Agreed, would love to see this in the library!

paul-muckypuddle avatar Nov 06 '18 17:11 paul-muckypuddle

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

Codex- avatar Mar 25 '19 21:03 Codex-

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.

Tyler-V avatar May 23 '19 13:05 Tyler-V

@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 :(

Codex- avatar May 23 '19 19:05 Codex-

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)

Tyler-V avatar May 23 '19 19:05 Tyler-V

+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 :/

Reached avatar May 28 '19 08:05 Reached

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

Sauvetonbio avatar Oct 08 '19 14:10 Sauvetonbio

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

mohammadrafigh avatar Oct 30 '19 20:10 mohammadrafigh

What is missing for the PR to be integrated?

sguimont avatar May 13 '20 21:05 sguimont

@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.

Yermo avatar May 13 '20 21:05 Yermo

I will update PR asap.

mohammadrafigh avatar Jun 18 '20 09:06 mohammadrafigh

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

sguimont avatar Jun 18 '20 11:06 sguimont

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

Sauvetonbio avatar Jun 18 '20 14:06 Sauvetonbio

@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.

Yermo avatar Jun 18 '20 16:06 Yermo

@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.

mohammadrafigh avatar Aug 01 '20 20:08 mohammadrafigh

@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.

b44rd avatar Dec 14 '21 08:12 b44rd

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

Codex- avatar Dec 14 '21 10:12 Codex-