I want to draw something like this:
gooogle maps example
but using osmdroid with OpenStreetMaps.
I have a set of GPS points prepared but I cannot find ay working example
Has anyone done this?
PathOverlay will not do the job properly: it has been optimized for drawing lines, and this is causing issues when using it for filled polygons (when the polygon is partly inside the view, and partly outside).
You can use the OSMBonusPack Polgon overlay.
A PathOverlay will give you the polygon. You may have to extend PathOverlay to create the fill color.
Related
I have been working on nutiteq maps, and I need to draw a trace over map, as my location changes, but it should be with different width(5m, 10m) and need to calculate where its overlapping itself. I draw lines dinamicly with line.setVertexList(arr_lat_long), but I think that this isn't an good approach to do this job. Think to draw them like a polygons, because then will calculate overlapping with JTS. But it will be very slow operation :/. Is there an another way to draw over the map, some other paint tool or lib to help me. The purpose is to fill some area with these traces..
Thanks
Can anyone, help me draw a circle or rather precisely an Arc with a given center point (GeoPoint) and the start and end points as well. So basically, it should help me draw a sector with given center point along with start and end points. I'm planning to use PathOverlay as my baseclass from OSMdroid, so that it would be easier for me to remove or add.
I understand the greatCircle provided in PathOverlay of OSMdroid, but not quit sure how to make use of it, I was wondering if any sample example be provided. Also How would I set the center of this GreatCircle.
Don't use a PathOverlay to draw filled polygons: as you noticed, this doesn't work properly when portions of the polygon are outside the screen.
for filled polygons, use an OSMBonusPack Polygon.
For setting the points of your arc, there is no ready-to-use API currently.
A "great circle" on a map represents the shortest "as the crow flies" path between two points. It is going to look like a straight line on your map. You need to think of the Earth as a sphere when considering the centre of the great circle; the centre is of course, the centre of the Earth.
Very simple question : since MapView inherits from View, is it possible to override draw() to draw whatever you want on the map ?
No, but you can use polylines, polygons, circles. If that's not enough you can put any bitmap (even one you draw to using Canvas) combined with ground overlay. If that's not enough, you can also use tile overlay to draw on entire map efficiently.
It's all there in the documentation, I encourage you to study.
Drawing directly can be always done on a view that overlaps with map, but it won't scroll with map nicely, so better to use technics above.
Drawing directly on the map is impossible, because it doesn't happen in your process afaik.
I have a particular need with a mapView and i can't find any good solution.
I have a Mapview with some markers displayed on it, and it works perfectly.
My need is that i want to put a kind of layer/background on the screen, in order to "mask" the map, but i always want to see the markers, and keep all the mapview functionnalities (zoom, move, etc.)
Is there any solution available to do it?
I hope you understand my need.
Many thanks in advance.
Create an overlay that mask (cover) the part of the map that you want to cover. In the onDraw() of this oevrlay just draw something that achive your mask requirements (areas, colors and opacity).
To ensure that markers are always visible, you need to add the overlay with markers after you add the overlay that mask map to the mapView.getOverlays.add().
Enjoy it.
I wonder,
how can I draw a nice flight route between 2 points on a google map's
MapView?
look at this:
http://maps.forum.nu/gm_flight_path.html
this is exactly what I need.
thanks!
Look at my reply to question
How to draw a path on a map using kml file?
and there especially into the RouteOverlay class / draw method.
Since you only want to draw a simple straight line, you probably won't need the rest of the complexity there.