I want to us GoogleMaps1

I want to us

GoogleMaps1

Create a mark by LocationSensor tag

And change the camera mode

I don’t know the blocks

please by blocks

haloo eny body hear :heart_eyes:

To use Google Maps and create a marker using the LocationSensor along with changing the camera mode, follow these steps:

1. Add Components:

  • Google Maps: Add the Google Maps component.
  • Location Sensor: Add the Location Sensor component.

2. Steps for Creating a Marker with Location Sensor:

Step 1: Get User’s Location

  • In the Blocks section, use the LocationSensor1 component to get the current latitude and longitude of the device.
  • The block you need is:
    LocationSensor1.LocationChanged
    • This block will trigger whenever the user’s location changes.

Step 2: Add Marker to Google Maps

  • Inside the LocationSensor1.LocationChanged block, use the following:
    • GoogleMaps1.AddMarker
      • Parameters: Latitude (latitude), Longitude (longitude), and optional title and description.

Example:

When LocationSensor1.LocationChanged 
Do 
  GoogleMaps1.AddMarker(Latitude = Latitude, Longitude = Longitude)

Step 3: Move the Camera to User’s Location

  • After adding the marker, adjust the camera view to focus on the user’s location:
    • GoogleMaps1.MoveCamera
      • Parameters: latitude, longitude, and an optional zoom level.

Example:

GoogleMaps1.MoveCamera(Latitude = Latitude, Longitude = Longitude, ZoomLevel = 15)

Step 4: Change Camera Mode

  • You can modify the camera mode (e.g., tilt, rotation) using the GoogleMaps1.SetCamera block.
  • Example:
    • GoogleMaps1.SetCamera
      • Parameters: Latitude, Longitude, plus options for bearing, tilt, and zoom.

For a tilted camera view:

GoogleMaps1.SetCamera(Latitude, Longitude, Bearing = 0, Tilt = 45, Zoom = 15)

Final Example Block:

When LocationSensor1.LocationChanged
  Do 
    GoogleMaps1.AddMarker(Latitude = Latitude, Longitude = Longitude)
    GoogleMaps1.MoveCamera(Latitude = Latitude, Longitude = Longitude, ZoomLevel = 15)
    GoogleMaps1.SetCamera(Latitude = Latitude, Longitude = Longitude, Bearing = 0, Tilt = 45, Zoom = 15)

This setup will add a marker based on the device’s current location, move the camera to that location, and adjust the camera’s angle for a more dynamic view.

Let me know if you need more details or adjustments!