How do I put a switch in maps to on and off the location?

can some one help i want to add a switch for the location sensor on my map

Probably like this:

image

Map must be set to use the Location Sensor
You cannot put a switch "on the map" it would have to be nearby, above/below etc.

If you're using the Map's built-in location sensor object to show the user, you could also try this:

do youll know how to make the marker show the location on the map

You will need to set at least one marker in the designer for the map component. Either use this marker, and set the coordinates, visibility, image asset, or use the marker blocks to create a runtime marker.

can you show the blocks

A simple map using Map How to put my location on a map might be what you are looking for,