-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MapBox SymbolLayer Items #10517
Comments
@nikiizvorski would you be able share a bit of code? |
`Well imagine you need to add 500 pictures to the map. What would be your way to add them to a SymbolLayer since i haven't found a way since it supports only Bitmaps and there is no device that runs that configuration for me. FeatureCollection featureCollection = FeatureCollection.fromFeatures(markerCoordinates);
` |
Here is an adapted example of our SymbolGenerator activity. It reads out 500 points from a geojson file, generates a TextView and converts that to a Bitmap. You store that Bitmap in a I need to add that 500 bitmaps might be setting the expectations a bit high. Since bitmap operations are costly, it can result in halting the map momentary, though this wasn't explicitly noticeable in gif above: |
Well thats something completely different. Can you please try to do some images from URL and convert them back to bitmaps with Glide on a small device like S5 with 32 VM. Really want to see how is that possible. Seems i cannot find a efficient way. Since doing a TextView as a bitmap is not heavy operation and you are reusing the Bitmap in the pool this shouldn't block it for you i don't know why is stuck for you like that as the example on the gif. Thanks |
Trying that example on mine crash the JNI directly and doesn't want to go forward with the same activity. I understand where you are going with the HashMap but please check my remark on the implementation we are trying to achieve. Since the example thats put is not the exact situation. |
Is there any solution for multiple object,I am facing same problem,Map is Slow when i added many SymbolLayer into map |
You shouldn't add many Symbol Layers use one. And avoid putting much on the client if your implementation doesn't specifically require that. I think there is a better way to do it on a server side. As other people did. Other than that use one Symbol Layer. |
Thank you for you response, The problem is how can I set different bitmap in different location when using one symbol layer |
Okay,Thank you so much |
You can create even a custom view as they did but you don't need. The HashMap Implementation of mapbox.addImages() as a big one can improve a bit. But the difference between addImage on a single element is not big on my tests. |
Would happy run some additional tests but I don't have a datasets with any images url at hand.
I don't see any problems with converting your current implementation into what I'm proposing: create an asynctask, get all the images you want with glide synchronously and put that into a hashmap. Additionally there are other ways of preloading data or using something as a CustomSource to have more fin grained control over what is displayed when. @nikiizvorski it doesn't seem you are actively looking into the applying any of my suggestions. You remarks aren't constructive and your expectations are off (have you tried loading in 500 images on the main thread in ImageViews in a scrollable container? I don't think performance will be great for that either). I ticketed out #10526 as follow up work. Going to close this issue in favour of that one. @AlexLiuSheng I'm not sure about your use-case but why would you like to add many symbolLayers to your map? In most cases 1 will be sufficient with the correct configuration. |
Platform: Android
Mapbox SDK version: 5.2.0-beta5
Steps to trigger behavior
Expected behavior
Is there a better way to load multiple objects to the map. If so please share?
There is currently no example or good way to show that many objects to the map.
Actual behavior
Thanks you
The text was updated successfully, but these errors were encountered: