StaticMap is a library to generate and display static image maps across UWP platforms, in the same vein as this blog post.
Using static images instead of the full blown maps control can massively improve performance where the added interactions aren't necessary.
There is a sample project in StaticMaps.UWP.Sample, which boils down to
- create a provider
- use the control
...
xmlns:staticMaps="using:StaticMaps"
...
<Page.Resources>
<staticMaps:GoogleMapsProvider x:Key="MapProvider"/>
</Page.Resources>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<staticMaps:StaticMap
Height="200"
Width="100"
MapProvider="{StaticResource MapProvider}"
/>
</Grid>
- MapProvider sets the source of generated maps. This is required for anything to happen. Must implement {{IMapProvider}}, with {{GoogleMapsProvider}} currently the only one available
- Center sets where the map should be centred, must be of type Coordinate. Optional, and shouldn't be used with EncodedPolyline
- EncodedPolyline displays an encoded polyline on the map, shouldn't be used with Center
The height and width of the supplied static image are inferred automatically from the size of the control.
Currently, only GoogleMaps is supported, using the GoogleMapsProvider.