Reputation: 4599
I have a map view and a listview on the same screen. Half is map and the other half is listview. I have a list of locations(ie ,lats and lons). When I Start my activity it should load all the locations on the map and it should point to the first location in my list and others should not be visible.There is a button on each listview item. When I tap on any of the button on listview item, map should animate to that particular location. There is one more button at the top of the screen to see all the locations, when I tap on this button, it should show all the locations in the list, on the Map. The number of list item may vary. How can I do it
Upvotes: 0
Views: 1437
Reputation: 2628
Try do the things, such as creating overlays on mapView on click of each item(button) of listView just use AnimateTo() to animate to the location converting location(lat,lng) to point using Point methods.You have to create overlay for each location(i.e. when item click) and add it to list of Overlays.
But this approach will not work to display all locations on one click of button on to overlay you have been created on mapView.
If you create overlay for each location and add it to list of overlays and try to display may be it works fine but the locations which are plotted first may be not visible properly(try to set transparency of overlay) instead you can make search for Google api which takes list of locations and plot them.
Hope this explaination works for you.
Upvotes: 1
Reputation: 954
Since you know the locations before loading them, you can write code to present the list in the sidebar. If you load KML files, then it is completely different and it requires parsing the file yourself in order to get the data inside. I did this once myself with string parsing, but the whole project was extremely slow. I'd found JAK but it required registering and I didn't use it
Upvotes: 0