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
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Find location name

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

7 REPLIES 7
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Find location name

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

Re: Find location name

Thank you so much! It worked! 

GertVonck
Level: Powered On

Re: Find location name

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

Re: Find location name

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.

Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Find location name

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

Re: Find location name

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.

Highlighted
Sarang24Dev
Level: Powered On

Re: Find location name

Hi,

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

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,877)