Git Product home page Git Product logo

googlemaps.locationservices's Introduction

-- Help Wanted --

I've not got the Windows setup to manage this library. If you have the time to help, It'd be greatly appreciated. <3

GoogleMaps.LocationServices

A simple library for Google Maps geolocation and reverse geolocation.

The easiest way to get hold of it is to install the Nuget package.

From the package manager console: PM> Install-Package GoogleMaps.LocationServices

Example Lookup

using GoogleMaps.LocationServices;
.....

AddressData[] addresses = new AddressData[] 
{
    new AddressData // Belgium
    {
        Address = "Rue du Cornet 6",
        City = "VERVIERS",
        State = null,
        Country = "Belgium",
        Zip = "B-4800"
    },
    new AddressData
    {
        Address = "1600 Pennsylvania ave",
        City = "Washington",
        State = "DC"
    },
    new AddressData
    {
        Address = "407 N Maple Dr. #1",
        City = "Beverly Hills",
        State = "CA"
    }
};

// Constructor has 3 overload
// No parameters. It does not use API Key
var gls = new GoogleLocationService();

// Boolean parameter to force the requests to use https 
// var gls = new GoogleLocationService(useHttps: true);

// String paremeter that provides the google map api key
// var gls = new GoogleLocationService(apikey: "YOUR API KEY");
foreach (var address in addresses)
{
    try
    {
        var latlong = gls.GetLatLongFromAddress(address);
        var Latitude = latlong.Latitude;
        var Longitude = latlong.Longitude;
        System.Console.WriteLine("Address ({0}) is at {1},{2}", address, Latitude, Longitude);
    }
    catch(System.Net.WebException ex)
    {
        System.Console.WriteLine("Google Maps API Error {0}", ex.Message);
    }
                
}

googlemaps.locationservices's People

Contributors

sethwebster avatar iabusida avatar bcuff avatar qwertydog avatar dkopack avatar luis-palacios avatar mgravell avatar a-a-k avatar adrotter avatar myles-mcdonnell avatar

Watchers

James Cloos avatar George Okello 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.