Comments (6)
I would only set the visibility of markers to GONE or VISIBLE because adding and removing the markers causes the parent layout to recalculate its size.
from mapview.
@devjta What I do when there is a lot of markers on the screen at once is that I start randomly hide them. If you have > 10k markers as you say then no one could possibly see anything useful with all of them visible anyway, so it's better to start hiding stuff randomly to reduce the clutter (it will still just look like a mess of markers to the user, but from a performance perspective it should be a lot better). Then as the user zooms in, less items will be on the screen at once and you can let more markers be visible.
The other option obviously being to cluster several nearby items together in a single marker (but again as this isn't supported natively by the library you would have to roll your own solution).
from mapview.
@az-faro yeah, we kinda need some z-index logic and hide the pins which are mostly behind.. sounds like a good idea.
And yeah, I would need to add the clustering in there. If I get it to run successfully, I would even upload it. We already customized many things in the library, so we basically forked it already.
from mapview.
This library supports markers lazy loading, which does what you describe. You can see an example in the demo app (see "Markers lazy loading").
EDIT: sorry I thought the issue was about MapCompose. MapView indeed does not support markers lazy loading, and is on maintenance mode. So you're right, you would have to manually set markers visibility.
from mapview.
Thanks for the info, I might look into MapCompose then.
As for MapView, would you say adding and removing the entire markers is better or worse from a performance perspective vs just hiding the markers that shouldn't be shown?
from mapview.
I would also need performance and/or clustering in the old one.. We dont want to use compose, as we had really bad experience. Our customers are still using crappy devices and everything was just slow, so we needed to redo everything in XML again..
Just so you know, what I am talking about: We are talking about something like >10k points on a single screen. The map is not infinite (its a plan of a building).
The original https://github.com/moagrius/TileView could handle that better.. But it had issues with recycling bitmaps and crashing the app then -.-
from mapview.
Related Issues (20)
- MarkerView is not removed from the MapView HOT 5
- rectangular tiles HOT 1
- scrollTo / scrollToAndCenter using different coordinates after scaling HOT 6
- Can you support drawing points? HOT 2
- Draw polygon HOT 1
- BitmapFactory: bitmap marked for reuse HOT 3
- Non-existent zoom on an overlay. HOT 21
- Clear memory HOT 2
- maker cant be moved as MapCompose HOT 1
- can you support Marker Drag? HOT 4
- Mini gaps between tiles HOT 2
- How to click or long click on map to add marker.
- Support for .png deep zoom map
- bitmap marked for reuse can't fit new bitmap error (100% reproducible) for Remote HTTP mapview HOT 5
- Possibility to zoom farther out? HOT 1
- Issue when setting compileSdkVersion to 34 HOT 2
- Offset/padding? HOT 7
- Can you add azimuth and map scale? HOT 1
- Setting minimum scale mode and zooming below FILL equivalent gives scaling issues HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapview.