user124e
user124e

Reputation: 1

how do i get different map types on flutter

I am using fluttermaps to get the basic osm(open street map)layer to appear. it works but I am trying to add more options. Does anyone have any tips on where to go.

I have this so far and its working but I want different types of options on flutter map like you would using maps on iphone. Not using google maps


TileLayer get openStreetMapTileLayer => TileLayer (
      urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
      userAgentPackageName: 'dev.fleaflet.flutter_map.example',
);

Upvotes: -1

Views: 445

Answers (2)

user124e
user124e

Reputation: 1

The answer was pretty simple. Hope this helps someone else. I read on fluttermaps docs that they accept tiles from everywhere even web servers. So all I had to do was copy the tile urls from my website over.

Upvotes: 0

Shakila
Shakila

Reputation: 1059

you can use map controller and options for such additional features

FlutterMap(
    mapController: MapController(),
    options: const MapOptions(
      initialCenter: LatLng(42.58, 12.43),//like this
      initialZoom: 6,
    ),
    children: [],
);

doc:- https://docs.fleaflet.dev/

Upvotes: 0

Related Questions