Skip to content

olevett/staticmaps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StaticMap Build status

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.

Usage

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>

Properties on the control

  • 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.

Supported Providers

Currently, only GoogleMaps is supported, using the GoogleMapsProvider.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published