I used Skobbler Android SDK to draw Polygon and Polyline, but this happened on MapBox and iOS as well, so I think it may be a general issue in Open Street Map..
When I add Polygon and Polyline with exactly same Coordinate list, I have different result below.
Polyline draws correctly for coordinates, but Polygon draws strangely. Why does Polygon do this kind of wrong behaviour and how to draw same as Polyline correctly??
Thanks in advance.
Related
I was wondering if Polyline can be animated in open street map. I looked but couldn't find anything satisfactory.
I am talking about something like this site http://econym.org.uk/gmap/example_cartrip2.htm
Here the route is drawn between two points. I want animation for a polyline that is just a line between two points.(Not a route)
Can this be done? If so how?
I am able to get current direction when i walk. What i try to make is drawing an arc or quarter circle to my direction and getting edge points of my circle.
Actually i am trying to get 3 points. I am able to get my current location. The other 2 locations are the edge points of my arc in my direction. It is not a must drawing arc or circle to my direction. Maybe drawing polygon is acceptable for me.
Can you help me to find out a solution on this ?
Thanks,
Maybe you can start reading the documentation of Shapes in the Google Maps Android API, it explains here some simple ways to add shapes to your maps in order to customize them for your application.
Polyline is a series of connected line segments that can form any shape you want and can be used to mark paths and routes on the map.
The Polyline class defines a set of connected line segments on the map. It also consists of a set of LatLng locations, and creates a series of line segments that connect those locations in an ordered sequence. Just check the this link on how to create Polylines
Polygon is an object that are similar to Polyline objects in that they consist of a series of coordinates in an ordered sequence. However, instead of being open-ended, polygons are designed to define regions within a closed loop with the interior filled in. You can add a Polygon to the map in the same way as you add a Polyline.
Circles is a geographically accurate projection of a circle on the Earth's surface drawn on the map.
The following code snippet adds a circle to the map by constructing a CircleOptions object and calling GoogleMap.addCircle(CircleOptions):
// Instantiates a new CircleOptions object and defines the center and radius
CircleOptions circleOptions = new CircleOptions()
.center(new LatLng(37.4, -122.1))
.radius(1000)); // In meters
// Get back the mutable Circle
Circle circle = myMap.addCircle(circleOptions);
For more sample code check the documentation and this link.
I draw a polygon between two latitude and longitude but polygon line shows far from road.
Like the picture above, blue polygon line shows far from road. Where polygon line is draw there is no road. Anyone can help me to draw right polygon between two latitude and longitude.
Thank you!
If you want draw a route between two address, you should use Directions API.
or relative to this post google-maps-api-v3-how-show-the-direction-from-a-point-a-to-point-b-blue-line
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.
I am currently developing an application that tracks your path, so it always draws on the map. I want to know if it is possible to draw on the road, since my application gets my location and its not precise, its always near(about 30 m radius) me. I want it not to add it where it is, but on the nearest road
You can draw the path on the map using the Ployline class of Google Map as below:
Polyline line=myMap.addPolyline(new PolylineOptions().add(new LatLng(location.getLatitude(),location.getLongitude())).color(Color.RED));
For more details about it please refer here