Skip to content

Commit

Permalink
docs(readme): add details about open street map provider (fleaflet#495)
Browse files Browse the repository at this point in the history
* docs(readme): add details about open street map provider

* style(lint): fix styling

* docs(readme): remove mapbox mention
  • Loading branch information
pumano authored Jan 30, 2020
1 parent 3b69443 commit a639b6d
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Add flutter_map to your pubspec:
dependencies:
flutter_map: any # or the latest version on Pub
```
Configure the map using `MapOptions` and layer options:

```dart
Expand Down Expand Up @@ -50,6 +49,7 @@ Configure the map using `MapOptions` and layer options:
}
```

### Azure Maps provider
Configure the map to use [Azure Maps](https://azure.com/maps) by using the following `MapOptions` and layer options:

```dart
Expand Down Expand Up @@ -86,6 +86,39 @@ Widget build(BuildContext context) {

To use Azure Maps you will need to [setup an account and get a subscription key](https://docs.microsoft.com/en-us/azure/azure-maps/quick-demo-map-app)

### Open Street Map provider
Configure the map to use [Open Street Map](https://openstreetmap.org) by using the following `MapOptions` and layer options:

```dart
Widget build(BuildContext context) {
return new FlutterMap(
options: new MapOptions(
center: new LatLng(51.5, -0.09),
zoom: 13.0,
),
layers: [
new TileLayerOptions(
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
subdomains: ['a', 'b', 'c']
),
new MarkerLayerOptions(
markers: [
new Marker(
width: 80.0,
height: 80.0,
point: new LatLng(51.5, -0.09),
builder: (ctx) =>
new Container(
child: new FlutterLogo(),
),
),
],
),
],
);
}
```

### Run the example

See the `example/` folder for a working example app.
Expand Down

0 comments on commit a639b6d

Please sign in to comment.