Since Microsoft is ending Bing Maps, will MapWinGIS work with Azure Maps as a tileprovider ?
Hello,
I have the same problem and I’m interested if anyone has a solution or method to integrate Azure Maps
Thanks
Did you folks ever figure this out? I’m guessing that Microsoft did in fact turn Bing Maps off in June.
I had no problem getting Azure Map Tiles to work once I registered for an access key (with a credit card, of course). Same URL with key + x, y, zoom setup that we’re used to. The only rub I found is that they don’t have a hybrid map (Satellite + Names/Streets) similar to Google available. They handle it a bit differently - you use their satellite base tileset, then use a roads/features tiles as an overlay. Not sure if that’s going to work with MapWinGIS.
Thanks Bob
Can you show me an example to declare the Azure Map provider?
I must be making a mistake with the URL
Thanks in advance
No problem:
TileProviders providers = axMap1.Tiles.Providers;
int providerId = (int)tkTileProvider.ProviderCustom + 1;
providers.Add(providerId, “Azure Base Hybrid”, “https://atlas.microsoft.com/map/tile?subscription-key=WdXP1OggAZ5iKsxrlv5vOhtietcetcetcetcetcJ99AKACYeBjFgCv8oAAAgAZMP29vQ&api-version=2024-04-01&tilesetId=microsoft.base.hybrid&zoom={zoom}&x={x}&y={y}&tileSize=256”, tkTileProjection.SphericalMercator, 0, 19);
axMap1.Tiles.ProviderId = providerId;
I’m not 100% sure that 19 is the max zoom level, but it works for me.
Thanks Bob.
I corrected the URL and everything works
Glad to hear it! Hopefully we can get more folks into this community. Starting to look like a ghost town. People should also be aware that you can use the Google Map Tile service for free up to a certain threshold, and then it’s pretty inexpensive after that. That’s if you’re not still using the “other” Google Map Tile service that does not require a session key or account.
Thank you Bob. Could post an example on how to use Google Maps as a Tile provider for MapWindow, and also the “other” tile service
I can meet you half way. The long arm of google stretches everywhere.
For the legit Google Map Tile service, you’ll need to sign up for an account. Once you do, you’ll add Google Maps to your list of subscribed services and APIs. That will allow you to generate an API Key. Using curl and the API key you will send in parameters that determine what kind of tile you’re after and any embellishments (roads, streetview, etc.). This generates a session key. Together, your Tile requests will look like this:
sSessionKey and sAPIKey are defined and populated earlier, as mentioned.
string sFullURL = “https://tile.googleapis.com/v1/2dtiles/{zoom}/{x}/{y}?session=” + sSessionKey + “&key=” + sAPIKey;
providers.Add(providerId, “Google Hybrid Tile”, sFullURL, tkTileProjection.SphericalMercator, 0, 22);
Thank you Bob. But I’m having a problem with the custom tile providers:
Dim providers as TileProviders = AxMap1.Tiles.Providers
Dim nproviderid As Integer = tkTileProvider.ProviderCustom + 1
providers.Add(nproviderid, “Azure Base Roads”, “https://atlas.microsoft.com/map/tile?subscription-key=” & AzureKey & “&api-version=2024-04-01&tilesetId=microsoft.base.road&zoom=15&x=5236&y=12665&tileSize=256”, tkTileProjection.SphericalMercator, 0, 19, “Microsoft Azure Maps”)
AxMap1.Tiles.ProviderId = nproviderid
AxMap1.Redraw()
And it shows the OpenStreetMap. What am I doing wrong ?
Thanks in advance for the help!
What you typed works fine for me as long as you substitute in your azure key for " & AzureKey &", making sure there are no spaces or double-quotes.
e.g: https://atlas.microsoft.com/map/tile?subscription-key=WdXP1OggAZ5iK...lots_of_key_Omitted_Herev8oAAAgAZMP29vQ&api-version=2024-04-01&tilesetId=microsoft.base.road&zoom=15&x=5236&y=12665&tileSize=256
This is what I get:
Thank you Bob. Yes, it does work if I type it in the browser, but it’s not working as a tile provider for mapwindows.
This is how I have it in code:
Dim nproviderId As Integer = providers.Add(tkTileProvider.ProviderCustom, “Azure Maps”, “https://atlas.microsoft.com/map/tile?subscription-key=” & AzureKey & “&api-version=2024-04-01&tilesetId=microsoft.base.road&zoom={z}&x={x}&y={y}&tileSize=256”, tkMapProjection.PROJECTION_GOOGLE_MERCATOR, 0, 19)
AxMap1.TileProvider = nproviderId
But it keeps showing OpenStreetMap tiles.
Update:
Was getting an url malformed error and a projection error also. I fixed that:
Dim result As Boolean = providers.Add(1025, “Azure Maps”, “https://atlas.microsoft.com/map/tile?subscription-key=” & AzureKey & “&api-version=2024-04-01&tilesetId=microsoft.base.road&z={zoom}&x={x}&y={y}&tileSize=256”, tkMapProjection.PROJECTION_WGS84, 0, 19)
Got the custom provider correctly added (result is true). No errors reported by the tiles.providers. lasterrorcode either.
AxMap1.Tiles.ProviderId = 1025
No error whatsoever but get blank map, no tiles are shown
Any ideas ?
Thanks, George
I had errors like this which were caused by cache usage.
you can delete the cache file (.db3) or use ClearCache() to test
Phil
Thank you Phil, but no change after clearing cache. Also, I have the use server option to True.
George
I would also be interested to know if there is a solution to this. The loss of Bing Maps in June 2025 is a bit of blow, especially satellite imagery, as we use it as a base map for a new application (that uses MapWinGIS) that is being launched early 2025. Thus, we’re looking for a replacement for Bing Maps satellite. Azure maps could be an option if it works. Have tried to add MapTiler (https://www.maptiler.com/) as a custom tile provider, but experience similar problems, it fails and/or it defaults to displaying OSM. If anyone has got a custom map provider working (ideally using VB code) for any provider, I would appreciate seeing some example code to see if that helps resolve the problem. Any help would be much appreciated. John