syncfusion / xamarin-demos

This repository contains the Syncfusion Xamarin UI control’s samples and the guide to use them.
https://www.syncfusion.com/xamarin-ui-controls?utm_source=github&utm_medium=listing
320 stars 203 forks source link

Can you show us how to track location #21

Open papyr opened 4 years ago

papyr commented 4 years ago

Hello, I have someone who is a dog walker or a bicyclist, but your samples don't show this.

  1. How can I get the SF compoment in phone to push the location data back with phone ID to the Syncfusion Map and show the history. Can you show me a snippet.
  2. How can I ensure both phone and web server ASP WebAPI are in sync, or buffred if data connection is lost.
  3. Also how to show icons on the map, bus stop, road etc.

Thanks

jeyakasipandi commented 4 years ago

Hi @papyr ,

Query 1: How can I get the SF compoment in phone to push the location data back with phone ID to the Syncfusion Map.

We would like to let you know that you can achieve this requirement by adding the Xamarin SfMaps to get the current location of device by using the Geolocation.GetLastKnownLocationAsync() method of Xamarin.Essentials and add the marker pin on maps using the current location values. Please refer the below KB for this.

https://www.syncfusion.com/kb/11379/how-to-show-the-current-gps-location-in-xamarin-forms-maps-sfmaps

Query 2: How can I ensure both phone and web server ASP WebAPI are in sync, or buffred if data connection is lost.

As we do have support to render maps with given input data and show marker over it based on the input geo coordinate points. We would like to inform that the reported scenario should be ensured in application using required API's. You can ensure the connectivity related cases using the below link.

https://docs.microsoft.com/en-us/xamarin/essentials/connectivity?tabs=android

Query 3: Also, how to show icons on the map, bus stop, road etc

You can achieve this requirement by creating a custom marker (inheriting from MapMarker class) using MarkerTemplate property and you can set the value for Latitude and Longitude property to show marker on SfMaps.

https://help.syncfusion.com/xamarin/maps/markers#add-custom-marker

papyr commented 4 years ago

Hello thanks, I saw this code to send the location. Can you tell me,

        CustomMarker marker = new CustomMarker();
        marker.Latitude = location.Latitude.ToString();
        marker.Longitude = location.Longitude.ToString();
        this.layer.Markers = new ObservableCollection<MapMarker> { marker };
  1. Does the observable auto sync/send the data to the server
  2. Is it received in the correct order (QOS)
  3. How can I draw a trails of a biker, jogger etc, with over them to show the persons information, both inside the Mobile Sync Xamarin and also ASP Core), hot to cold, green to red (red is the most recent)
RabhiaBehamK commented 4 years ago

Hi Papyr,

Query 1: Does the observable auto-sync/send the data to the serve

We would like to suggest that you can fetch data and create the marker collection based on data and assign it to the Markers property or bind to the Markers. So, the marker automatically updates the map based on data.

Query 2: Is it received in the correct order (QoS)

We would like to let you know that the marker will be rendered in maps based on the marker collection.

Query 3: How can I draw trails of a biker, jogger, etc, with over them to show the persons information, both inside the Mobile Sync Xamarin and also ASP Core), hot to cold, green to red (red is the most recent)

You can achieve this scenario by defining the marker template using MarkerTemplate. Please refer to the below help document link.

https://help.syncfusion.com/xamarin/maps/markers?cs-save-lang=1&cs-lang=xaml#add-custom-marker

Show the information by enabling the ShowTooltip and set value for ValuePath property in TooltipSettings of Marker. Please refer to the below help document link.

https://help.syncfusion.com/xamarin/maps/tooltip#tooltip-for-markers

For ASP Core, we can able to plot the location in the maps using the marker. The marker shape can be changed using the "Shape" property in the marker settings. Marker color can be changed using the "colorValuePath" in the marker settings. Please find the sample reference below.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SyncfusionWebApplicationMapSample-1709640556

papyr commented 4 years ago

Hello @RabhiaBehamK I understand the marker class, but I wanted the server bind for the actual location updates.

When the jogger or car moves - we need a sample showing the data stream push from ASP server to SF control on the mobile and web side. This data binding/push is what I am asking because as it is now, its very convoluted and long process to get data updates. For e.g. how can I get a syncfusion class on the server side, with a delegate or a signalR scenario to push updates to the Marker, when the jogger moves.

papyr commented 2 years ago

Any updates?

papyr commented 1 year ago

Hello @bharatdwarkani @georgelivingston @jeyakasipandi any updates on this?