cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Find location name

Is it possible that I can find location name according to Latitude and Longitude?

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

Yes, you can use the Bing Maps connector to do that. You'll need to register for a Bing Maps account at https://www.bingmapsportal.com/, where you'll get an API key to be able to "talk" to that API. Once you have it, you can add a Bing Maps connector to your app, and once you have it, you'll be able to use its GetLocationByPoint function to retrieve the location name.

 

For example, if you set the OnSelect property of a button to the following formula:

Set(myLocation, BingMaps.GetLocationByPoint(Location.Latitude, Location.Longitude))

Then once you click the button, you should be able to get the location name by using the name property of the myLocation variable:

myLocation.name

Notice that you don't need to use a button - you can also set that expression in the app's OnStart (or a screen OnVisible) property, and the location name will be available without the need for the user's interaction.

View solution in original post

9 REPLIES 9
CarlosFigueira
Power Apps
Power Apps

Yes, you can use the Bing Maps connector to do that. You'll need to register for a Bing Maps account at https://www.bingmapsportal.com/, where you'll get an API key to be able to "talk" to that API. Once you have it, you can add a Bing Maps connector to your app, and once you have it, you'll be able to use its GetLocationByPoint function to retrieve the location name.

 

For example, if you set the OnSelect property of a button to the following formula:

Set(myLocation, BingMaps.GetLocationByPoint(Location.Latitude, Location.Longitude))

Then once you click the button, you should be able to get the location name by using the name property of the myLocation variable:

myLocation.name

Notice that you don't need to use a button - you can also set that expression in the app's OnStart (or a screen OnVisible) property, and the location name will be available without the need for the user's interaction.

View solution in original post

Anonymous
Not applicable

Thank you so much! It worked! 

Hi CarlosFigueira,

 

Just tried this and it works like a charm in the powerapps web studio (I've setup an Azure Enterprise API - free version). I used it on the OnStart so when I open the app in the web studio it loads the Country in a variable (Set(myLocation, BingMaps.GetLocationByPoint(Location.Latitude, Location.Longitude).address.countryRegion))

 

Now when I try to open the app in play mode (on the laptop or on my smartphone), this variable is not populated. 

 

Are you aware of this issue? Or did I overlook something?

 

Thanks,

 

 

Gert

Anonymous
Not applicable

Hello, I tried your recommendation but I could not get my county. 

 

When I write this code(BingMaps.GetLocationByPoint(Location.Latitude; Location.Longitude).name), I am just getting the latitude and longitude values, however I want my county to return.

 

thanks in advance.

I believe you're having the same issue as in this thread: given that you're using ';' to separate the parameters to that function, I'm guessing the locale you're running uses ',' as the decimal separator by default. The Bing Maps API needs the latitude and longitude values to be passed using '.' as the decimal separator, so if you change your expression to the following, it should work.

BingMaps.GetLocationByPoint(
    Text(Location.Latitude; "[$-en-US]0.0000000"; "en-US");
    Text(Location.Longitude; "[$-en-US]0.0000000"; "en-US")).name
Anonymous
Not applicable

Hello @CarlosFigueira,

 

Thanks for help. It worked, but it returns following statement: 

 

"Londra Asfaltı Caddesi 92C, 34"

 

I want it to return as "Buyukcekmece".

 

How can I do it?

 

Thanks a lot.

Hi,

Can you provide some guidance to do this using google maps API for reverse geocoding?

To get the Country or region name of current user you need to use:

 

 

BingMaps.GetLocationByPoint(Location.Latitude, Location.Longitude).address.countryRegion

 

 

Check detailed get location response properties at: Bing Maps Connector 

Hi @CarlosFigueira ,

 

I have used the same formula on my App OnStart, but I am only getting my City and my country name in the label,

 

I want to have the complete address from the coordinates any help?? 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,140)