Google Maps Live Location İcons

0
0

Hello,

I’m using the Google Maps plugin on Hybrid. I want to display the user’s real-time location information on the map with Google Maps’ standard icon.

How can I achieve this?

Thank you,

Best regards

Attachment
  • You must to post comments
0
0

There are two steps to this:

1.Get the user’s location using Wisej Hybrid. Note that this will only work in a Hybrid application, not a regular Wisej application.
Hybrid documentation on location: https://docs.wisej.com/hybrid/start/api/location
var location = Device.Geolocation..GetLocation()

Note that if this code is not working, you may need to request to the user that they enable location permissions:
Device.Permissions.Request(PermissionType.LocationWhenInUse);
Device Permissions documentation: https://docs.wisej.com/hybrid/start/api/permissions/wisej.hybrid.devicepermissions

2. Display the user’s location using the Google Maps extension.
I believe that the Google Maps extension doesn’t currently have a blue location dot implemented that looks like the one in your picture.
Some options:
– You could use a marker instead

this.googleMap1.AddMarker("Marker1", latitude, longitude)
//where latitude and longitude are doubles

documentation on AddMarker function: https://docs.wisej.com/extensions/extensions/googlemaps/api/wisej.web.ext.googlemaps.googlemap#addmarker-markerid-lat-lng-options-center

– You could run some javascript code, similar to this:
https://developers.google.com/maps/documentation/javascript/examples/map-geolocation
Or this:
https://stackoverflow.com/questions/30440777/show-blue-dots-icon-on-current-location-google-maps
For information on calling JavaScript functions from C#, you can use the Call() and Eval() functions, see here: https://docs.wisej.com/docs/concepts/javascript

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.