All Projects → ericnewton76 → Gmaps Api Net

ericnewton76 / Gmaps Api Net

Licence: apache-2.0
C# google maps api interface for interacting with the backend web services for Google Maps

Projects that are alternatives of or similar to Gmaps Api Net

Explore Flutter Firestore
This is a Flutter App with Firebase's Cloud FireStore Database and Google Map. This app represents that Beautiful UI can be implemented with the Best Performance.
Stars: ✭ 152 (-37.7%)
Mutual labels:  google-maps
Google Maps
Google Maps Web Services API wrapper for .NET
Stars: ✭ 171 (-29.92%)
Mutual labels:  google-maps
Meteor Google Maps
🗺 Meteor package for the Google Maps Javascript API v3
Stars: ✭ 198 (-18.85%)
Mutual labels:  google-maps
Meetinthemiddle
👬 Meet In The Middle
Stars: ✭ 158 (-35.25%)
Mutual labels:  google-maps
Nibo
Android Place picker dependent on Google places, made a custom version so I could style it anyway I wanted for my current project, WIP
Stars: ✭ 170 (-30.33%)
Mutual labels:  google-maps
Airbnb Android Google Map View
This is a sample Android Application which has Google Map view similar to what AirBnb Android Application. Moving Markers like Uber/Ola. Custom Google Search for places. Recycler view with Animations added.
Stars: ✭ 175 (-28.28%)
Mutual labels:  google-maps
Airmapview
A view abstraction to provide a map user interface with various underlying map providers
Stars: ✭ 1,824 (+647.54%)
Mutual labels:  google-maps
Laravel Auth
Laravel 8 with user authentication, registration with email confirmation, social media authentication, password recovery, and captcha protection. Uses offical [Bootstrap 4](http://getbootstrap.com). This also makes full use of Controllers for the routes, templates for the views, and makes use of middleware for routing. The project can be stood u…
Stars: ✭ 2,692 (+1003.28%)
Mutual labels:  google-maps
React Native Maps
React Native Mapview component for iOS + Android
Stars: ✭ 12,795 (+5143.85%)
Mutual labels:  google-maps
React Native Open Maps
🗺 A simple react-native library to perform cross-platform map actions (Google or Apple Maps)
Stars: ✭ 192 (-21.31%)
Mutual labels:  google-maps
Anymaps
Easily switch between Google, Baidu and OSM maps
Stars: ✭ 164 (-32.79%)
Mutual labels:  google-maps
Load Google Maps Api
🌏 A lightweight Promise-returning helper for loading the Google Maps JavaScript API
Stars: ✭ 166 (-31.97%)
Mutual labels:  google-maps
Twitter Intelligence
Twitter Intelligence OSINT project performs tracking and analysis of the Twitter
Stars: ✭ 179 (-26.64%)
Mutual labels:  google-maps
Aerialbot
A simple yet highly configurable bot that tweets geotagged aerial imagery of a random location in the world.
Stars: ✭ 157 (-35.66%)
Mutual labels:  google-maps
Marker Animate Unobtrusive
Google Maps markers become animated, unobtrusively
Stars: ✭ 203 (-16.8%)
Mutual labels:  google-maps
Track Ip
Advanced Ip Tracker Tool
Stars: ✭ 150 (-38.52%)
Mutual labels:  google-maps
Earth Reverse Engineering
Reversing Google's 3D satellite mode
Stars: ✭ 2,083 (+753.69%)
Mutual labels:  google-maps
Gmapsfx
Java API for using Google Maps within a JavaFX application.
Stars: ✭ 233 (-4.51%)
Mutual labels:  google-maps
Jquery Auto Geocoder
jQuery plug-in to automatically geocode and display a location entered.
Stars: ✭ 227 (-6.97%)
Mutual labels:  google-maps
Googleway
R Package for accessing and plotting Google Maps
Stars: ✭ 187 (-23.36%)
Mutual labels:  google-maps

Google Maps API for .NET

AppVeyor Nuget Join the chat at https://gitter.im/gmaps-api-net/Lobby

A .NET library for interacting with the Google Maps API suite.

NuGet package: https://www.nuget.org/packages/gmaps-api-net/

PS> Install-Package gmaps-api-net

Overview

This project attempts to provide all the features available in the Google Maps API. It is being developed in C# for the Microsoft .NET including .Net Framework v4.6.1+ and .Net Standard v1.3+. gmaps-api-net is a fully featured API client library, providing strongly typed access to the API.

Notable Upcoming

  • Trying to achieve a formal v1.0 release for 2018. This is basically on-track for first week of January. File any major issues quickly to get addressed before v1.0!
  • Planning a slight namespace/usage change for v2.0 release soon thereafter to support dependency injection and mocking away the library in your own testing apparatus. Intention here is to isolate away the library returning values to returning known values during your testing. See branch feat/support-dependency-injection
  • In relation to above, we will begin removing our tests for specific values, and testing instead for schema changes that Google is pushing through.

API Support

Currently the library supports full coverage of the following Google Maps APIs:

  • Geocoding
  • Elevation
  • Static Maps
  • Directions
  • Distance Matrix
  • Places
  • Time Zones
  • Street View, added to v0.19

Quick Examples

Using Google Maps API for .NET is designed to be really easy.

Quick Note about the Google Maps API Key

Google is now requiring a proper API key for accessing the service. Create a key here, or create/find an existing one in your Google Developers Console.

Getting an address from the Geocoding service

Let's suppose we want to search an address and get more information about it. We can write:

//always need to use YOUR_API_KEY for requests.  Do this in App_Start.
GoogleSigned.AssignAllServices(new GoogleSigned("YOUR_API_KEY"));

var request = new GeocodingRequest();
request.Address = "1600 Pennsylvania Ave NW, Washington, DC 20500";
var response = new GeocodingService().GetResponse(request);

//The GeocodingService class submits the request to the API web service, and returns the
//response strongly typed as a GeocodeResponse object which may contain zero, one or more results.

//Assuming we received at least one result, let's get some of its properties:
if(response.Status == ServiceResponseStatus.Ok && response.Results.Count() > 0)
{
    var result = response.Results.First();

    Console.WriteLine("Full Address: " + result.FormattedAddress);         // "1600 Pennsylvania Ave NW, Washington, DC 20500, USA"
    Console.WriteLine("Latitude: " + result.Geometry.Location.Latitude);   // 38.8976633
    Console.WriteLine("Longitude: " + result.Geometry.Location.Longitude); // -77.0365739
    Console.WriteLine();
}
else
{
    Console.WriteLine("Unable to geocode.  Status={0} and ErrorMessage={1}", response.Status, response.ErrorMessage);
}

Getting a static map URL

Static Maps API support allows you to get a valid url or a streamed bitmap which you can use:

//always need to use YOUR_API_KEY for requests.  Do this in App_Start.
GoogleSigned.AssignAllServices(new GoogleSigned("YOUR_API_KEY"));
var map = new StaticMapRequest();
map.Center = new Location("1600 Pennsylvania Ave NW, Washington, DC 20500");
map.Size = new System.Drawing.Size(400, 400);
map.Zoom = 14;

Sample for ASP.Net WebForms:

//Web Forms: Page method contains above code to create the request
var hyperlink = (Hyperlink)Page.FindControl("Hyperlink1");
hyperlink.NavigateUrl = map.ToUri().ToString();

For MVC controllers/views:

//MVC: controller contains above code to create the request
ViewBag["StaticMapUri"] = map.ToUri();

//MVC: view code
<img src="@ViewBag["StaticMapUri"]" alt="Static Map Image" />

You can also directly retrieve the bitmap as a byte array (byte[]) or as a Stream:

For WPF/xaml applications:

//for WPF:
BitmapImage img = new BitmapImage();
img.SourceStream = staticMapsService.GetStream(staticMapsRequest);

this.imageControl.Image = img;

Using a Google Maps for Business key

//enterprise users to use your supplied information for requests.  Do this in App_Start.
GoogleSigned.AssignAllServices(new GoogleSigned("gme-your-client-id", "your-signing-key", signType: GoogleSignedType.Business));

// Then do as many requests as you like...
var request = new GeocodingRequest();
//...
var response = GeocodingService.GetResponse(request);

Using a Google Maps API key

//always need to use YOUR_API_KEY for requests.  Do this in App_Start.
GoogleSigned.AssignAllServices(new GoogleSigned("your-api-key"));

// Then do as many requests as you like...
var request = new GeocodingRequest();
//...
var response = GeocodingService.GetResponse(request);

You can also use a particular key for a single request:

const GoogleSigned apikey = new GoogleSigned("special_api_key_here");
var request = new GeocodingRequest();
//...
var service = new GeocodingService(request, apikey);

Contact

Questions, comments and/or suggestions are welcome! Please raise an issue in GitHub or send an email to:

Contributors

A big thank you to all of our contributors including:

Forked from a work originally created by Luis Farzati and incorporating ideas from Brian Pedersen

A note to Contributors

In order to maintain the project files' formatting, please get the EditorConfig plugin that works with your favorite IDE. Many options available.

This will go a long ways towards helping to maintain formatting so that actual changes arent lost in formatting changes... And that's a good thing, yes? 😉

The .editorconfig file specifies the desired formatting. It basically uses an out-of-the-box Visual Studio 2013 C# editor configuration.

And to all who contribute... Thank you!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].