How to load markers dynamically for current position in Android google-maps?

前端 未结 4 1516
野性不改
野性不改 2021-02-04 20:39

I\'m currently developing an app for Android which uses google map service. Because users will be able to see thousands of markers I would like to load only those which are curr

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-04 21:08

    The answer would depend on where your markers are coming from. Are they stored within the Android device itself or are they coming from a web server? Either way, if you need to represent thousands of locations symultaneously you might need to implement some form of clustering, which can be done on the client or on the server, if markers come from the web.

    See, for example this server side clusterer (2 different versions):

    http://maps.forum.nu/server_side_clusterer

    http://maps.forum.nu/server_side_clusterer/index2.php

    or a client side clusterer:

    http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/

    Another alternative would be to use custom tiles, (like Google does), but depending on your exact needs it may be overkill.

提交回复
热议问题