开发者

Help needed with multiple itemized overlays on a mapview

开发者 https://www.devze.com 2023-03-14 11:25 出处:网络
I am looking for some help.... Firstly I have a database server side with a numerous amount of locations(longs +lats)

I am looking for some help....

Firstly I have a database server side with a numerous amount of locations(longs +lats)

Now there are upto a 1000 for one city alone. At the moment, my android device all the information at once. I then create 1000 itemized overlays and add them to the map view. This in turn makes my emulator and phone run slow.

One idea I had was to zoom in on a location and then download and place a subset of the overlays on the map view. Trouble I have with this 1. When I scroll on the map I don't know what event to register a listener to. 2. When the user zooms out I will still create the large开发者_开发技巧 number of itemised overlays.

My question to you guys is,

How could I overcome these problems? Or how would you go about doing this?

The solution Would be something similar to how google maps works. U c a not so detailed map when u zoom out, but when u zoom in it shows you a detailed map that reloads as you move around


I then create 1000 itemized overlays and add them to the map view.

Ummmm... please tell me that this is a typo, and you meant "1000 OverlayItems", not "1000 ItemizedOverlays".

1000 OverlayItems might be bad enough -- ItemizedOverlay isn't really designed for that many points.

When I scroll on the map I don't know what event to register a listener to.

I don't think there is a straightforward solution here. I think others have kinda reverse-engineered the touch events and are listening on those. See Android Maps get Scroll Event for more.

When the user zooms out I will still create the large number of itemised overlays.

Use a prioritization scheme. What you see with Google Maps is that only the top N items are shown, where "top" is based on some sort of priority mechanism.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号