Is it possible to use the full Azure maps in Flutter?

Mike Taylor 116 Reputation points
2023-11-28T16:33:54.48+00:00

I have implemented Azure maps using the FlutterMap plug calling a urlTemplate of "atlas.microsoft.com/map/tile/png?api-version=1&layer=basic....." which works in a very simple form in that I can see a map and I can plot a marker on that map.

However, is it possible to use the full map control in Flutter?

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
836 questions
0 comments No comments
{count} votes

Accepted answer
  1. rbrundritt 20,921 Reputation points Microsoft Employee Moderator
    2023-11-28T18:21:12.01+00:00

    There won't be any official Azure Maps flutter control anytime soon. What you could possibly do is run the web version of Azure Maps within a WebView control of a flutter app, but this would require writing code in JavaScript outside of the flutter environment. There are native iOS and Android SDK's for Azure Maps which you might be able to wrap with a flutter API, but I'm not aware of any existing projects out there that do this currently.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Mike Taylor 116 Reputation points
    2023-12-01T09:35:21.1066667+00:00

    I am a little bit stuck here trying to load custom Icon's into the map. The code works fine in an IIS/C# application. The image is listed as an asset in my pubspec.yaml file and I get the error shown below. I have tried setting the path to all number of variants and even trying to load it directly from the live server using HTTPs, but I get this error every time.

    It appears to be coming from atlas.min.js which I understand is the Azure map control.

    Any suggestions pleas?

     var iconPromises = [
         // Add custom icons
         map.imageSprite.add('icon-25', 'assets/25.gif'),
     ];
    
    "Fetch API cannot load file:///android_asset/flutter_assets/assets/assets/25.gif. URL scheme must be "http" or "https" for CORS request.", source: https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.js (108)
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.