How to visualize the Bing Maps using Flutter Maps?
In Syncfusion® Flutter Maps, you can visualize the Bing Maps and customize it easily.
To add Bing Maps, you must set the urlTemplate property of MapTileLayer in SfMaps as mentioned below.
Step 1: For Bing Maps, subscription key is needed to request tiles. Create your own Bing Maps key by following the steps mentioned in this link and replace the “YOUR_KEY” in the below code snippet with actual key.
Step 2: Then, convert the above URL into the required Bing Maps URL format using the top-level getBingUrlTemplate method and set the URL returned from this method to the urlTemplate property.
@override
Widget build(BuildContext context) {
return Scaffold(
body: FutureBuilder(
future: getBingUrlTemplate( 'https://dev.virtualearth.net/REST/V1/Imagery/Metadata/RoadOnDemand?output=json&uriScheme=https&include=ImageryProviders&key=YOUR_KEY'),
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.hasData) {
return SfMaps(
layers: [
MapTileLayer(
urlTemplate: snapshot.data as String,
),
],
);
}
return CircularProgressIndicator();
}
),
);
}
For android, make sure you have enabled internet permission in the android manifest file in release mode under root_directory/android/app/src/main/AndroidManifest.xml.
Screenshot:
Check the below links for more features in tile layer.
- https://www.syncfusion.com/flutter-widgets/flutter-maps
- https://help.syncfusion.com/flutter/maps/tile-layer
Live samples,
- https://flutter.syncfusion.com/#/maps/tile-layer/bing-maps
- https://play.google.com/store/apps/details?id=com.syncfusion.flutter.examples
- https://apps.apple.com/us/app/syncfusion-flutter-ui-widgets/id1475231341
Package reference,
Hope you enjoyed learning about how to visualize the Bing Maps using Flutter Maps.
You can refer to our Flutter Maps feature tour page to learn about its other groundbreaking feature representations. You can explore our Flutter Maps documentation to understand how to present and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other components.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!