I am trying to put an arcgis WMTS tile layer on top of openstreetmaps WMTS layer in flutter using the flutter_map plugin. Here is my code :
Widget build(BuildContext context) {
return MaterialApp(
home: FlutterMap(
options: new MapOptions(
center: LatLng(33.8, 9.5),
zoom: 6.0,
pinchZoomWinGestures: MultiFingerGesture.pinchZoom,
),
layers: [
//layer 1 - leaflet tiles
TileLayerOptions(
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
subdomains: ['a', 'b', 'c'],
tileProvider: NonCachingNetworkTileProvider(),
backgroundColor: Colors.black,
),
//Layer 2 - leaflet tiles
TileLayerOptions(
urlTemplate:
"https://tiles.arcgis.com/tiles/C8EMgrsFcRFL6LrL/arcgis/rest/services/GEBCO_contours/MapServer/tile/{z}/{x}/{y}",
subdomains: ['a', 'b', 'c'],
tileProvider: NonCachingNetworkTileProvider(),
backgroundColor: Colors.transparent,
),
],
),
);
but the arcgis map does not align correctly with the openstreetmap.
I hope you can help me rectify my code and have a great day