Why polygon line shows far from road in google maps in android? - android

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

Related

Polyline points are not accurate while moving

When you draw a polyline, those points near the turns are not accurate while moving they are placed on the top of the buildings and sometimes instead of a proper polyline there is a line from the source to destination.What I want to do is a polyline must stick on to the road.So how do I fix this?
I am following this link:
Please find the screenshots for more clarification.

Android getting points of a specific direction in some meters in google map

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.

Polygon does not draw correctly in Open Street Map

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.

Android GoogleMap draw line through a known way

I am using Google Map Api V2 and I can marker or draw a line between two points.But I try to draw a line through the route of a bus.So Route,Ways,Stopping places...etc of the bus are already known.First of all, I tried to find all LatLong values of the route and I draw it as polylines but I guess it is wasting time.So I want to draw line without find out all LatLong points of route of the bus.Is there any way ?
Thanks for the help..
You can use the Directions API to get the directions between two points, but this probably wont match your bus routes.

is it possible to draw on road based on a location near it

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

Categories

Resources