Issue
Is there any way to draw map overlay (like iOS MKOverlayView) in Android? (MapView tutorial)[https://developers.google.com/maps/documentation/android/hello-mapview] covers only itemized overlay items, but I need something like this:
(source: cluttr.com)
In other words, I want to draw my own map over Google map, so, there should be method like drawMap(Rect, zoomScale, ...); Any suggestion?
Thank You!
Solution
It looks like there is no any special magic interface in Android... So, I'm gonna use standard maps and implement tile rendering engine from scratch. Overlay and override draw method with something like this:
@Override
public void draw(Canvas canvas, MapView mapV, boolean shadow){
if(shadow){
GeoPoint gpos = new GeoPoint(selLat,selLon);
Projection projection = mapV.getProjection();
Point pt = new Point();
projection.toPixels(gpos, pt);
[...]
super.draw(canvas,mapV,shadow);
}
}
Answered By - Tutankhamen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.