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

Bing Maps Connector - how to limit requests?

Hi,

 

I'm using Bing Maps Connector (https://docs.microsoft.com/en-us/connectors/bingmaps/#get-static-map).

I've created an image, and put

BingMaps.GetMapV2(
    "CanvasLight";
    16;
    Location.Latitude;
    Location.Longitude;
    {
        pushpinLatitude: Location.Latitude;
        pushpinLongitude: Location.Longitude;
        pushpinIconStyle: 37
    }
)

I've now realised that his makes loads of API calls to Bing Maps - for 3 users, we've exceeded 2500 calls in total, as the image keeps refreshing. How would I limit the number of requests to 1? So to make sure that the image is only loaded once, even if the user is moving? 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Bing Maps Connector - how to limit requests?

Hi @jernejp 

A possible workaround could be to retrieve your image when your app starts, and to store the result in a variable. Here's what to add to the OnStart property.

 

Set(varMap;
    BingMaps.GetMapV2(
        "CanvasLight";
        16;
        Location.Latitude;
        Location.Longitude;
        {
            pushpinLatitude: Location.Latitude;
            pushpinLongitude: Location.Longitude;
            pushpinIconStyle: 37
        }
    )
)

You would then set the image property of your image control to varMap. By doing this, you'll only call Bing Maps when your app starts.

3 REPLIES 3
Super User
Super User

Re: Bing Maps Connector - how to limit requests?

Hi @jernejp 

A possible workaround could be to retrieve your image when your app starts, and to store the result in a variable. Here's what to add to the OnStart property.

 

Set(varMap;
    BingMaps.GetMapV2(
        "CanvasLight";
        16;
        Location.Latitude;
        Location.Longitude;
        {
            pushpinLatitude: Location.Latitude;
            pushpinLongitude: Location.Longitude;
            pushpinIconStyle: 37
        }
    )
)

You would then set the image property of your image control to varMap. By doing this, you'll only call Bing Maps when your app starts.

jernejp
Level: Powered On

Re: Bing Maps Connector - how to limit requests?

Works like a charm, thanks @timl !

jernejp
Level: Powered On

Re: Bing Maps Connector - how to limit requests?

One more question - now it sometimes happens that the image doesn't load.

I'm setting the variable a couple times during the app, and it only starts working after the variable has ben set twice or three times. Any ide why that would happen, and how to make sure it gets set?

Thanks!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 169 members 5,250 guests
Please welcome our newest community members: