CartoDB / mobile-sdk

CARTO Mobile SDK core project
https://carto.com/docs/carto-engine/mobile-sdk/
BSD 3-Clause "New" or "Revised" License
182 stars 65 forks source link

Would it be possible to define the ViewRange of Points / Markers independently? #299

Open carlos-mg89 opened 5 years ago

carlos-mg89 commented 5 years ago

So here is my situation. I have a tone of points of interest, and would like to define different cases depending on several information. For example:

Right now, I've set up everything in 2 VectorLayers, one for 'important' points and another one for less important ones. However, as you can see, based on my ideas it's not practical to have 15-20 vector layers, each based on the different ViewRange.

Is there any way of doing this in a Point / Marker level? I haven't found the methods that allow to do so.

mtehver commented 5 years ago

If you want a guaranteed ordering of the markers/points, then multiple layers is the only way really. (For example, you want important points to be on top of other points). Otherwise, I do not see why two layers are needed.

mtehver commented 5 years ago

I did not read the question with full attention, sorry. So I guess you are using multiple layers because you want to use different visible zoom ranges for your elements? In that case you need multiple layers.

Another option is to use VectorTileLayer and CartoCSS for styling. With SDK 4.2.0 this got easier as you can use GeoJSONVectorTileDataSource for your points. Unfortunately we do not have any examples demonstrating this feature.

carlos-mg89 commented 5 years ago

Reading a GeoJson file and rendering the points in it using the GeoJSONVectorTileDataSource would be really great. But I can clearly see that you have no examples at the moment. It would be wonderful if you could provide some when possible. I bet it'll be way better than my current setup, which I feel is a bit chaotic and even a bit twisted.

carlos-mg89 commented 5 years ago

@mtehver I think I've managed to make it my code work with the GeoJSONVectorTileDataSource, using a FeatureVector to start with. Instead of a GeoJson file. However, I'm not able to load images, and I've seen this old issue that has the same error than I've got. Could you spare some help with this matter please?

https://github.com/CartoDB/mobile-sdk/issues/40