Giter VIP home page Giter VIP logo

xaml-map-control's Introduction

XAML Map Control

A set of controls for WPF and UWP for rendering digital maps from different providers and various types of map overlays.

Map providers can easily be added by specifying an URL template for their map tile bitmaps. Map overlay layers allow to draw and interact with graphical objects and pushpins on the map. The Map Control API is similar to the Microsoft Bing Maps Control for WPF, except that no API key is needed.

The project includes sample applications for both platforms, which demonstrate the features of XAML Map Control.

Map Control supports multiple map projections. However, the MapTileLayer class only works with WebMercatorProjection. For other projections, an appropriate WmsImageLayer could be used.


Main classes are

  • MapBase: The core map control. Provides properties like Center, ZoomLevel and Heading, which define the currently displayed map viewport.

  • Map: MapBase with basic mouse and touch input handling for zoom, pan, and rotation.

  • MapTileLayer: Provides tiled map content (e.g. from OpenStreetMap) by means of a TileSource.

  • MapImageLayer: Provides map content that covers the entire viewport (e.g. from a Web Map Service).

  • MapItemsControl: Displays a collection of MapItem objects (with a geographic Location).


The WPF version allows to use a System.Runtime.Caching.ObjectCache instance for caching map tile bitmaps. The cache may be set to an instance of System.Runtime.Caching.MemoryCache (e.g. MemoryCache.Default), but caching can also be done persistently by some specialized ObjectCache implementation. Map Control comes with two such implementations:

  • ImageFileCache, an ObjectCache implementation that stores each cached map tile as a single image file, in the original file format delivered by the map provider (typically PNG or JPG). ImageFileCache is part of the MapControl.WPF library. It does not support expiration, which means that cached tile image files will not be deleted automatically. The cache may hence consume a considerable amount of disk space.
  • FileDbCache, an ObjectCache implementation based on EzTools FileDb, a simple, file based No-SQL database, in a separate library FileDbCache.WPF.

If you want to try the sample application with persistent caching, uncomment the appropriate TileImageLoader.Cache setting in the sample application's MainWindow.xaml.cs file. Please note that some map providers may not allow persistent caching of their map data.

For UWP, the cache functionality is defined by the interface IImageCache in the namespace MapControl.Caching, and implemented by the classes ImageFileCache and FileDbCache (in library FileDbCache.UWP). Local image files are written to the ApplicationData.Current.TemporaryFolder by default.


XAML Map Control is available on NuGet, with Package Id XAML.MapControl.


The project is not open for contributions. Pull requests will not be accepted.

xaml-map-control's People

Contributors

clemensfischer avatar pchentrmb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.