-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CustomLayer usage to add custom tiles as map layer #4210
Comments
|
No, that's not what I meant. The custom tile layer can be added dynamically, e.g. user pressed some button. In your case I need to change style url and reload all data, which previously was added. And user can edit this layer by some request to a server, e.g. change period of history which he is seeing on the map. And so, I should be able to invalidate this layer, because server's tiles was changed. |
Ah, thanks for the clarification. From the screenshots and explanation above, the raster tiles look simple enough that they could be represented more efficiently as GeoJSON rather than as raster images. (GeoJSON makes things like mapbox-gl-draw possible with the GL JS library.) The Android SDK has support for GeoJSON at the source level. #3630 tracks dynamically modifying GeoJSON layers at runtime, while #837 tracks dynamically adding and removing layers, paint properties, etc. As far as I know, the combination of those two features would enable the use case you’re describing. |
Thank you for your answer. GeoJSON is a cool feature, but described by me functionality is not the same. and etc. |
In that case, I think #837 is the one you want to keep an eye on. Here’s what I mean: although this GL JS example uses a GeoJSON layer, there’s nothing that prevents you from calling |
Thanks for the explanation. If by this style I will be able to use raster tiles from any custom server - it will be a good solution.
|
Image source support (#1350) may also be relevant to your use case. |
I missed this detail – you want to explicitly reload a raster tile source rather than adding and removing distinct raster tile sources at runtime. The iOS SDK does have a method for reloading the style, but it doesn’t bust the cache. (The only thing that currently busts the cache is the |
@pahakorolev we've now added the runtime style API and closed #837, this exposes new ways to add a raster or GeoJSON layer to the map. For examples, I'd recommend taking a look at this ticket, there's a few examples showing how to add layers. To use in your application now, make sure you have the SNAPSHOT version of the SDK in your |
MapBox Android SDK has methods to work with
CustomLayers
:But using of those require native(cpp) implementation of CustomLayer like at your example.
It's so difficult, because we need to implement render and other parts of
CustomLayer
.How about simple implementation for using raster tiles over rendered map like
TileOverlay
andUrlTileProvider
from Google Maps SDK for example?It is necessary first of all to support the rendering tiles from server side, which can contains a lot of data like polygons, polylines or paths, markers and images already rendered by server.
Here examples of tiles:
The text was updated successfully, but these errors were encountered: