mobile-sdk
mobile-sdk copied to clipboard
Would it be possible to define the ViewRange of Points / Markers independently?
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:
- Relevance (if the point has a Wikipedia entry)
- Visits or times bookmarked
- Type of point of interest (restaurants are less important than cathedrals, for example, so the cathedrals have to appear before)
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.
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.
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.
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.
@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