Giter Site home page Giter Site logo

tk.custommap's Introduction

Extended Map Control for Xamarin.Forms.Maps

NuGet Build status

This is an extended, bindable map control based on Xamarin.Forms.Maps. Here is a list of some available features:

  • Customize pins
  • Custom image
  • Draggable
  • and more
  • Add overlays
  • Circles
  • Lines
  • Custom polygons
  • Add and calculate routes
  • Start place prediction queries
  • Add custom map tiles via url template
  • Additional commands available
  • Long press
  • Map click
  • and many more

Look at the wiki for all available features and documentation.

Setup

Install the NuGet package.

Android

Add your Google Maps API key to your AndroidManifest.xml.

<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOUR API KEY" />

Following permissions should be added to your AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

If you plan to use the automatic route calculation, a valid key for the Google Maps Directions API is required. You can set it up anywhere in your PCL, simply call GmsDirection.Init("YOUR API KEY");.

If you plan to use the NativePlacesApi make sure you have a valid key for the Google Places API and set the key in your AndroidManifest.xml. Replace the following line

<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOUR API KEY" />

with

<meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR API KEY" />

iOS

Make sure you call TKCustomMapRenderer.InitMapRenderer(); in FinishedLaunching in your AppDelegate.cs.

If you plan to use the NativePlacesApi also call NativePlacesApi.Init();

public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
    Forms.Init();
    FormsMaps.Init();
    TKCustomMapRenderer.InitMapRenderer();
    NativePlacesApi.Init();
    
    LoadApplication(new App());
    return base.FinishedLaunching(app, options);
}

UWP

Make sure you call FormsMaps.Init("Your_key_here"); in your MainPage.xaml.cs before LoadApplication(new Sample.App());. Also you need the Location capability in your app manifest.

Contributions

If you want to contribute, please use the Development branch to submit PRs.

Known Issues

Image offset

If you notice wrong offsets or moving images during zoom, you can use the Anchor property to properly adjust the anchor point.

Video

Android

Android

iOS

iOS

Contributors

tk.custommap's People

Contributors

torbenk avatar jeancollas avatar jfversluis avatar jessejiang0214 avatar cliffcawley avatar yumshinetech avatar ranainside avatar

Watchers

Damian Karzon avatar James Cloos 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.