Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Map control: get clicked location

(0) ShareShare
ReportReport
Posted on by 291

Working on learning maps...

 

We have a map control 'Map1'. I'm just working on getting the clicked location. Doesn't appear to work. Tried a few things, searched a ton for what I might be missing. Coming up blank.

 

I have this code in the OnSelect of Map1; added the notification trying to check if anything looks to be happening.

 

ClearCollect(
 colLocation,
 {
 LocLat:Map1.ClickedLocation.Latitude,
 LocLong: Map1.ClickedLocation.Longitude
 }
);

Notify("Clicked: " & First(colLocation).LocLat,NotificationType.Success,2000)

 

Then I have a label trying to display the lat long, this is in the Text property

 

"Latitude: " & First(colLocation).LocLat & " Longitude: " & First(colLocation).LocLong

 

Thank you

 

@LaurensM @FLMike @WarrenBelz 

  • Rolson1 Profile Picture
    45 on at
    Re: Map control: get clicked location

    Thanks for the reply.  This works on my PC when I'm editing but when i publish it doesn't work on my devices.  Never encountered an issue like this.  

  • STS1SS Profile Picture
    291 on at
    Re: Map control: get clicked location

    What I have typed there...

    In the  'Text' property:

     

    Map1.ClickedLocation.Latitude & "," & Map1.ClickedLocation.Longitude

     

    It works fine. It wasn't at first, and then started working. I honestly think there are some issues with updates... like the app and what is on the server vs what you're dealing with can vary and so the code sometimes falls over. Just my opinion. Anyway, that works.

     

    LMK if you need help

     

  • Rolson1 Profile Picture
    45 on at
    Re: Map control: get clicked location

    did you ever figure this out?  I have a map control that works on desktop but not on tablet or mobile.  Just can't get anything to trigger when i click my icons

  • STS1SS Profile Picture
    291 on at
    Re: Map control: get clicked location

    Well, I had tried this before and it did not work, now it does...

     

    In the  'Text' property:

     

    Map1.ClickedLocation.Latitude & "," & Map1.ClickedLocation.Longitude

     

    So if anyone can inform me why the aforementioned attempts fail, that would be great.

     

    It seems like sometimes reloading the page a few times is all I need.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard