Hello everyone, I'm trying to make an app that logs the latitude and longitude into a table sent by sms.
The following code for testing has only 2 points location...
Note that you can use either the GoogleMaps or the OSMDroid library to display a path on a map.
Each has it's advantages and disadvantages.
This is the reference for the OSMDroid PathOverlay: PathOverlay Fields:
FILL AsStyle Geometry and text drawn with this style will be filled, ignoring all stroke-related settings in the paint.
FILL_AND_STROKE AsStyle Geometry and text drawn with this style will be both filled and stroked at the same time, respecting the stroke-related fields on the paint.
STROKE AsStyle Geometry and text drawn with this style will be stroked, respecting the stroke-related fields on the paint.
Methods:
AddGreatCircle (StartPoint AsGeoPoint, EndPoint AsGeoPoint, NumberOfPoints AsInt) Add NumberOfPoints points to the path to create a great circle path from StartPoint to EndPoint.
AddPoint (Latitude AsDouble, Longitude AsDouble) Add a Point to the path using Latitude and Longitude.
AddPoint2 (aLocation AsLocation) Add a Point to the path using a Location object.
AddPoint3 (aGeoPoint AsGeoPoint) Add a Point to the path using a GeoPoint object
AddPoints (GeoPoints AsList) Add a List of GeoPoints to the path.
ClearPath Clear all points from the path.
GetAllPoints AsList Get a List of all GeoPoints in the path.
GetBoundingBox AsBoundingBoxE6Wrapper Get a BoundingBox which represents the area that is covered by the path.
GetNumberOfPoints AsInt Get the total number of points added to the path.
Initialize (aMapView AsMapView, PathColor AsInt) Initialize the PathOverlay and set the PathColor
IsInitialized AsBoolean
Properties:
Alpha AsInt Get or Set the Alpha transparency of the path.
Values of 0 to 255 are valid.
Default value is 255 fully opaque.
Color AsInt Get or Set the color of the path.
PathStyle AsStyle[write only] Set the path style used to draw the path.
Valid values are:
PathOverlay.FILL
PathOverlay.FILL_AND_STROKE
PathOverlay.STROKE
Default value is PathOverlay.STROKE
StrokeWidth AsFloat Get or Set the stroke width used to draw the path.
Default stroke width is 2 pixels.
Dim and Initialize a PathOverlay.
Use it's AddPoint method to add your points.
Then use the MapView AddOverlay method to add the PathOverlay to the map.
Hi...Thanks very much to warwound's library I got it working. Now I can continue working with the app.
But I have another question in mind, is it possible to display multiple icon(person icon) when receiving from multiple sources of GPS? Sorry if I'm still new to this...can anyone give an idea how can it be done?
Again thank you in advance and more power to this forum..
You mention the person icon so it may be that you're displaying the user location using the SimpleLocationOverlay?
I've not tested but would imagine that you can add multiple instances of a SimpleLocationOverlay to a MapView.
The more 'traditional' method to display more than one Marker on a MapView is to use an Overlay such as the MarkersOverlay.
This will enable you to detect click and long click events on each Marker and also allow you to use custom icons for each Marker.