web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Map control: center on...
Power Apps
Unanswered

Map control: center on a location

(0) ShareShare
ReportReport
Posted on by 307

Is there a method to center the map on a lat/long?

 

I'm referring to the standard map control.

 

I want to allow the map to center on a pin or a resolved address or a lat/long.

 

I thought I'd be able to easily re-center the map... I'm starting to wonder if this is just wrong.

Categories:
I have the same question (0)
  • MudassarSZ365 Profile Picture
    591 on at

    Hi @STS1SS ,

    To center a map on a specific latitude and longitude, you typically use a method provided by the map control's API. For instance, if you're using Google Maps, you'd use the setCenter() method, passing in a location object with the desired latitude and longitude. This allows the map to re-center on a pin, a resolved address, or specific coordinates. The exact method might vary slightly depending on the map service you're using, but the concept remains the same: provide the coordinates to a function that sets the map's center.

    If you think my solution is helpful for you, then please accept it. 😊 Regards, Muhammad Mudassar Mazhar.

  • STS1SS Profile Picture
    307 on at

    I understand there 'should' be a method, I am just not finding anything. I did find some suggestions EG: us the "Center" property, but there is no center property. I am using the Map control available in power apps under INSERT >>> MEDIA >>> MAP.

     

    STS1SS_0-1699630181572.png

     

  • MudassarSZ365 Profile Picture
    591 on at

    @STS1SS ,

    You may use a formula to update these properties dynamically based on a pin or address you want to center on. Here's a general approach on how to do it:

    1. Set the Latitude property of the map control to the latitude of your pin or resolved address.
    2. Set the Longitude property of the map control to the longitude of your pin or resolved address.
    3. Optionally, adjust the Zoom property to get the desired level of zoom on the pin or address.

    The exact properties might be named slightly differently in the Power Apps map control, but the above steps provide a basic framework for how to set the map's center.

    If you can't find these properties directly in the map control, look for a data source or an item property of the map that might hold the latitude and longitude values. You would typically bind these properties to a context variable or a collection that holds your coordinates.

    If you think my solution is helpful for you, then please accept it. 

     

     Regards, Muhammad Mudassar Mazhar.

  • STS1SS Profile Picture
    307 on at

    Thanks for the input.

     

    To be sure I was clear, I am just trying to center map on demand.

     

    EG: On initialization map centers on the default location. The desired behavior is: User selects an item in a gallery and the map centers on that location. I couldn't get that to happen,

     

    Ultimately I ended up passing in the location as the default and this is working, but frankly it is not what I want or need. I like the feature that the default location is that pulsing dot, it is just aesthetically nice.

     

    Anyway, it seems like a very basic need: center the map on demand, whether that is an event or a gallery selection or whatever.

     

    Thanks

  • CD00131 Profile Picture
    42 on at

    I wanted to bump the Question if that's possible. I also wonder how this simple function works since I can't get it done.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard