cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bags999
Level: Powered On

Re: View maps in sharepoint/powerapps

Hello RT, 

 

I put this code: UpdateContext({strPrefix: "https://dev.virtualearth.net/REST/v1/Imagery/Map/Road?mapSize=500,500"}); UpdateContext({strPoints: Concat(Map, "&pp=" & Latitude & "," & Longitude & ";" & "26" & ";" & Lead)}); UpdateContext({strSuffix: "&key=[AtG-noaHGjI9jhOmlnvihTmePWHIX0q1fJwk8ZfkVn5wzSaLWLhUmTjVXOr5DPGz]"}); UpdateContext({imageURL: Concatenate(strPrefix, strPoints, strSuffix)}) in to my OnVisible property for Screen 2Capture.PNG

 

The button has the code: ClearCollect(Map,'Job List'). I found this as a way to get the collection into powerapps. 

 

When I set the image property to imageURL, the app shows no errors, but I don't show any map. 

 

Could you please point me towards what I am doing wrong? 

 

Thanks!

 

bags999

Microsoft RusselThomas
Microsoft

Re: View maps in sharepoint/powerapps

Hi bags999,

 

Quick way to check is to copy and paste the imageURL outcome into your browser and see a)whether it works and b)what the actual end URL you're building looks like if it doesn't.

 

You can create a label and set its Text value to imageURL, then play the app and check the URL.  You can also then copy and paste it into your browser address bar to see what's happening.

 

Feel free to paste it here too, happy to take a look at it 🙂

 

Kind regards,

 

RT

bags999
Level: Powered On

Re: View maps in sharepoint/powerapps

https://dev.virtualearth.net/REST/v1/Imagery/Map/Road?mapSize=500,500&key=[AtG-noaHGjI9jhOmlnvihTmeP...]

 

This is what I receive with the imageURL. Not sure why the middle part didn't come into the formula. 

 

Thanks for your support!

 

bags999

Microsoft RusselThomas
Microsoft

Re: View maps in sharepoint/powerapps

If that's your actual key, you might want to edit these posts and remove it, or at least change it on the API page once you get things working 🙂

 

My suggestion;

Take the strPoints piece out and test it separately. 

Check the variables section of your powerapps to see what's in it.

I assume Maps is a table?  What's in it?

 

The idea would be to test each piece of the formula separately until you're sure each is giving you the piece you need - then put them together into the imageURL.

 

Kind regards,

 

RT

bags999
Level: Powered On

Re: View maps in sharepoint/powerapps

Hello RT, 

 

I put in Value(Longitude), Value(Latitude)... in the str points and got:https://dev.virtualearth.net/REST/v1/Imagery/Map/Road?mapSize=500,500&pp=47.63156378,-122.20075238;2...

 

I also got this error: {"authenticationResultCode":"NoCredentials","brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2018 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","errorDetails":["Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation."],"resourceSets":[],"statusCode":401,"statusDescription":"Unauthorized","traceId":"c33b14cd4f924ac68bd2a2b50be45037|CO356342F5|7.7.0.0"}

 

What is this error about? Do I have to do something with the API? 

 

Thanks!

bags999

Microsoft RusselThomas
Microsoft

Re: View maps in sharepoint/powerapps

I can't get the full URL you posted, it keeps cutting off.

Can you paste it into a codeblock or remove the HTTPS piece so the forum doesn't format it as a link?

Microsoft RusselThomas
Microsoft

Re: View maps in sharepoint/powerapps

Ok, I managed to get it from the forum post notification email - couple of things;

 

  • First, the URL is too long.  To use that many points you will have to use the POST method
  • Next, the structure of the prefix is incorrect - 
  • dev.virtualearth.net/REST/v1/Imagery/Map/Road?mapSize=500,500&pp=...  should be 
  • dev.virtualearth.net/REST/v1/Imagery/Map/Road/?mapSize=500,500&pp=...
  • Then, you have a couple of 0,0 points, which will make your map zoom out to world level, so you need to remove or exclude those

 

Running your URL I removed the 0,0 points and reduced the total number of points to fall within range and got this map;

 

 

Using a POST method will allow a max of 100 points, but I've never used this so you may want to post a different question around this on the forum - I've never used it because so much information on one page is a lot for a user to take in 🙂

 

Hope this helps,


RT

Rebeccak
Level: Powered On

Re: View maps in sharepoint/powerapps

Hi There, were you ever able to get this map working. I am new to using this and I have followed every instruction I have found. I am also getting the correct string but no map. 

 

//dev.virtualearth.net/REST/v1/Imagery/Map/Road/?mapSize=500,500&pp=32.626733,-96.905955;27;Duncanville&pp=30.222313,-97.838358;27;S Austin&pp=33.056851,-96.694623;27;E Plano&pp=32.943257,-97.110539;27;Southlake&pp=30.395586,-97.750611;27;Austin&pp=33.425686,-96.565431;27;Lewisville&pp=33.027707,-96.829514;27;W Plano&pp=29.575272,-98.596324;27;NW San Antonio&pp=29.61048,-98.476703;27;Sonterra Park&pp=29.584395,-98.305846;27;Selma&key=[mydevkey]

Highlighted
Microsoft RusselThomas
Microsoft

Re: View maps in sharepoint/powerapps

Hi @Rebeccak ,

Yip, still works for me.

If I copy and paste that URL into the Image property of an image, adding the prefix HTTPS: and using my bing maps key, I get this;

forumGPS.JPG

Https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/?mapSize=500,500&pp=32.626733,-96.905955;27;Duncanville&pp=30.222313,-97.838358;27;S Austin&pp=33.056851,-96.694623;27;E Plano&pp=32.943257,-97.110539;27;Southlake&pp=30.395586,-97.750611;27;Austin&pp=33.425686,-96.565431;27;Lewisville&pp=33.027707,-96.829514;27;W Plano&pp=29.575272,-98.596324;27;NW San Antonio&pp=29.61048,-98.476703;27;Sonterra Park&pp=29.584395,-98.305846;27;Selma&key=YOURDEVKEYHERE

Kind regards,

RT

View solution in original post

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

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

Top Solution Authors
Top Kudoed Authors
Users online (6,293)