Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi team,
I have implementing live tracking app in which we have move the map via user marker tell me anyone how to move map?

What I have tried:

i have search on google but not found any solution
Posted
Updated 10-Oct-19 23:45pm
v2

1 solution

What you need to use is some sort of a location tracking object that tracks and updates your app with the updated location. Since you are using Ionic, I believe there might be some limitations as native integrations won't be available, but you can get started here, Background Geolocation - Ionic Documentation[^].

Google Maps then enables you to place the markers on the map based on the location objects (LatLong objects, Coordinates  |  Maps JavaScript API  |  Google Developers[^]), and using this you can place the markers. Take a look at this Google Maps' official website[^], where they have shown a working sample code that can render the Google Maps instance with a marker.

When Ionic provides you with an update, you must update the Google Maps instance and refresh the marker—removing the previous ones and adding a new one!

Although this is not what you are looking for exactly, but this can help you understand how to capture the location updates from the maps instances and perform an action, https://www.codeproject.com/Articles/1040389/Ok-Android-Broadcast-my-location.
 
Share this answer
 
v2
Comments
Member 14619265 11-Oct-19 5:52am    
sir thanks for your feedback.sir in my case marker is updated via user position change but map is not move via position.
actually at my mistake in question.i have move the map via user position.
like: location is show center but after change position move map.below i have share the link for demo:

http://jsfiddle.net/geocodezip/ouhLc6v2

above link used the directionalService but in my case i am not using directional service i have normally draw polyline.if i used directional service it will draw shortest path but in my case fixed point for every location.please sir tell me what i do?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900