Giter Club home page Giter Club logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 12, 2024
Hello Tomas,

Can you post relevant code of what you want to achieve and proposition for API 
change?
I wouldn't want this lib API to drift too far away from the original library.

Some control questions:
How many markers do you want to add this way?
Are you using clustering with addMarkersDynamically set to true?

Original comment by [email protected] on 10 Apr 2013 at 7:25

  • Changed state: NeedsMoreInfo

from android-maps-extensions.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 12, 2024
It was only idea. I have about 5000 markers on the map and I'm using 
addMarkersDynamically. Now I make DB query in the background thread and them 
already on the UI thread iterate over all rows in the cursor add call 
addMarker(). It is relatively fast. I only think that maybe should be faster if 
will be possible call addMarker() also from background thread. But it require 
some additional method which must be called after all markers will be added to 
propagate changes to the map. Now it crash by ConcurrentModificationException.

I have also thought about the possibility to not load (from DB) all markers but 
only for square region around displayed area. But I don't know how to do it 
fast. Clear all markers after every move it is relatively slow. If I will only 
add new ones after every move it will make duplicates or it is handled?

Original comment by [email protected] on 12 Apr 2013 at 8:46

from android-maps-extensions.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 12, 2024
The code is made to not call the original library unless necessary. So when you 
add 5000 markers, only a dozen or so are really created in the end.

I have just checked with LaunchTimeTestActivity available in demo project. For 
5000 markers with clustering and dynamic addition enabled it takes 180ms
This might be an issue of course, but I don't think adding synchronization to 
allow multiple threads access would decrease that.

One thing I can suggest is to add markers in packets using Handler. Take this 
as an example: 
https://github.com/mg6maciej/android-maps-v2-demo/blob/master/NewMapsDemo/src/pl
/mg6/newmaps/demo/AddMarkersInBackgroundExampleActivity.java

If you don't add all the markers, you can get some improvements, but you need 
to be careful not to add same marker twice.

Original comment by [email protected] on 12 Apr 2013 at 8:10

  • Changed state: Invalid

from android-maps-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.