Giter Club home page Giter Club logo

universalmapcontrol's Introduction

Universal Map Control

This Repository contains a Map Control for the Universal Windows Platform. It ist build with extensibility in mind and should be easy to adapt to your needs.

Features: - Touch input (scale, rotate and Move) - Mouse Input (Wheel, Doubleclick etc.) - Fast rendering of tiled layers with Win2d - Easy placement of other UI elements on the map. - Extensible and open source

Build state

##Supported Online-Maps The following Maps are currently supported. Lots of other Maps can easily be added (I am happy to accept pull requests for other map types!).

##Usage Minimal Configuration:

<umc:Map Name="map" ZoomLevel="3">
	<tiles:TileLayer />
</umc:Map>

For Eaxmples see the included Demos for Windows 8.1 and Windows Phone (Demo XAML).

<umc:Map Name="map" Heading="0" ZoomLevel="4.5" MapCenter="{Binding MapCenter}" PointerMoved="MapOnPointerMoved">
	<interactivity:Interaction.Behaviors>
		<behaviors:TouchMapBehavior />
		<behaviors:AnimatedValuesBehavior x:Name="animatedBehavior" />
	</interactivity:Interaction.Behaviors>

	<umc:Map.Resources>
		<tiles:LayerConfiguration x:Key="OSM" />
		<!-- 
		Google Maps Layers. Please make sure that you have the required Licenses before activating GoogleMaps!
		<tiles:LayerConfiguration x:Key="GoogleMap" LayerName="GoogleMaps" UrlPattern="http://mt{RND-1;2;3}.google.com/vt/lyrs=m&amp;x={x}&amp;y={y}&amp;z={z}" />
		<tiles:LayerConfiguration x:Key="GoogleSat" LayerName="GooglMapsSatellite" UrlPattern="http://mt{RND-1;2;3}.google.com/vt/lyrs=y&amp;x={x}&amp;y={y}&amp;z={z}" />
		-->
	</umc:Map.Resources>
	
	<tiles:TileLayer Configuration="{StaticResource 'OSM'}" />
	
	<!-- ItemsControl bound directly to the Model -->
	<ItemsControl ItemsSource="{Binding Peaks}">
		<ItemsControl.ItemsPanel>
			<ItemsPanelTemplate>
				<umc:MapItemsPanel />
			</ItemsPanelTemplate>
		</ItemsControl.ItemsPanel>
		<ItemsControl.ItemContainerStyle>
			<Style TargetType="ContentPresenter">
				<Setter Property="VerticalAlignment" Value="Center" />
				<Setter Property="HorizontalAlignment" Value="Center" />
				<!-- Binding Helper to allow Binding to the Attached Property 'Location' of the Map -->
				<Setter Property="utils:XamlHelper.LocationBinding" Value="PeakLocation" />
			</Style>
		</ItemsControl.ItemContainerStyle>
		<ItemsControl.ItemTemplate>
			<DataTemplate>
				<Grid>
					<Path Stroke="DarkGreen" StrokeThickness="3" umc:MapLayerBase.Location="{Binding MovingTarget}" Margin="20,80,0,0" HorizontalAlignment="Center">
						<Path.Data>
							<!-- SNIP: Path Data -->
						</Path.Data>
					</Path>
					<Border Background="DarkOliveGreen" Margin="20,80,0,0" Padding="2,2,2,0">
						<TextBlock Text="{Binding PeakName}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="15" />
					</Border>
				</Grid>
			</DataTemplate>
		</ItemsControl.ItemTemplate>
	</ItemsControl>
</umc:Map>

Screenshot

universalmapcontrol's People

Contributors

mjeanrichard avatar

Watchers

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