-
-
Notifications
You must be signed in to change notification settings - Fork 860
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitBook: [#3] Added Migration & Attribution Documentation
- Loading branch information
1 parent
1cf216a
commit 32e3fc1
Showing
7 changed files
with
80 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# To v1.1.0 | ||
|
||
The old method of adding attribution has been deprecated. You should now use [`AttributionWidget`](../usage/layers/attribution-layer.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# Layers | ||
|
||
The `layers` property takes a list of 'options' that should be extensions of `LayerOptions`. The actual visual part of the map comes from layers. Multiple layers can be stacked on top of each other, to add other functionality on top of the basic map view. | ||
The `children` property takes a list of widgets, usually provided by this library, called 'layers'. The following pages detail how to use these layers. Multiple layers can be stacked on top of each other, to add other functionality on top of the basic map view. | ||
|
||
Layers are either tile layers (with tile providers), polygons, polylines, markers or any other custom layer or layer added by a supported plugin. However, if you wanted to show a widget that didn't need to interact with the map on top of the map (such as a compass), it would be recommended to place the `FlutterMap()` inside a `Stack()`, and then display that widget over the map in the stack. | ||
Each layer is in the format `...LayerWidget`, and takes an `options` argument which must be a `...LayerOptions`. | ||
|
||
The following sub-pages detail layers that you're likely to use on the map. | ||
This widget format is useful, as other widgets can be wrapped around each layer, such as `FutureBuilder` or `StreamBuilder`, which are especially useful in non-tile layers. | ||
|
||
{% hint style="info" %} | ||
The recommended way to add layers now is using the `children` property instead of `layers`. There are few differences, and this documentation will use the older `layers` property. | ||
Many of the subpages omit the `LayerWidget` and just demonstrate the `LayerOptions` inside a `layers` parameter. | ||
|
||
To use the `children` property instead, place any `LayerOptions` inside a `LayerWidget`'s `options` property. For example, `TileLayerWidget(options: TileLayerOptions(...),),`. | ||
This used to be the recommended way of adding layers, and can still be used (will not be deprecated). | ||
{% endhint %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Attribution Layer | ||
|
||
Before publishing your app to users, you should credit the tile server you use, this library, and potentially and plugins you use. | ||
|
||
```dart | ||
FlutterMap( | ||
options: MapOptions(), | ||
nonRotatedChildren: [ | ||
AttributionWidget.defaultWidget( | ||
source: 'OpenStreetMap contributors', | ||
onSourceTapped: () {}, | ||
), | ||
], | ||
), | ||
``` | ||
|
||
{% hint style="success" %} | ||
Please credit flutter\_map, it helps us to gain more developers that we can help! | ||
|
||
You should also credit your tile server if it says to in the server's terms of service. You must credit OpenStreetMap if using it. | ||
{% endhint %} | ||
|
||
## Default Builder | ||
|
||
The default builder, as shown above, can be used to get a classic attribution box appearance quickly without much setup. Just add a source and a function (if you want a clickable link to appear), and 'flutter\_map' automatically gets credited. | ||
|
||
## Custom Builder | ||
|
||
Alternatively, create your own box from scratch by omitting the `defaultWidget` constructor from the widget. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters