{"id":21731648,"url":"https://github.com/ericnewton76/gmaps-api-net","last_synced_at":"2025-05-15T15:06:07.891Z","repository":{"id":6877554,"uuid":"8126753","full_name":"ericnewton76/gmaps-api-net","owner":"ericnewton76","description":"C# google maps api interface for interacting with the backend web services for Google Maps","archived":false,"fork":false,"pushed_at":"2023-09-14T04:51:53.000Z","size":5912,"stargazers_count":284,"open_issues_count":46,"forks_count":151,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-04-10T06:40:19.461Z","etag":null,"topics":["c-sharp","editorconfig","google-maps"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"elm-community/builtwithelm","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericnewton76.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-02-10T19:16:07.000Z","updated_at":"2025-03-29T17:23:55.000Z","dependencies_parsed_at":"2024-06-18T13:49:04.255Z","dependency_job_id":"0b23139a-807c-4520-b99a-e7773ea3c71d","html_url":"https://github.com/ericnewton76/gmaps-api-net","commit_stats":{"total_commits":449,"total_committers":47,"mean_commits":9.553191489361701,"dds":0.4097995545657016,"last_synced_commit":"b44dbd13932eae30c2266ae6b47b48ea7d819ba9"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericnewton76%2Fgmaps-api-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericnewton76%2Fgmaps-api-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericnewton76%2Fgmaps-api-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericnewton76%2Fgmaps-api-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericnewton76","download_url":"https://codeload.github.com/ericnewton76/gmaps-api-net/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198425,"owners_count":22030967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","editorconfig","google-maps"],"created_at":"2024-11-26T04:26:58.268Z","updated_at":"2025-05-15T15:06:07.844Z","avatar_url":"https://github.com/ericnewton76.png","language":"C#","readme":"# Google Maps API for .NET\n\n[![AppVeyor](https://img.shields.io/appveyor/ci/EricNewton/gmaps-api-net.svg)](https://ci.appveyor.com/project/EricNewton/gmaps-api-net)\n[![Nuget](https://img.shields.io/nuget/v/gmaps-api-net.svg)](https://www.nuget.org/packages/gmaps-api-net/)\n[![Join the chat at https://gitter.im/gmaps-api-net/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gmaps-api-net/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nA .NET library for interacting with the Google Maps API suite.\n\nNuGet package: https://www.nuget.org/packages/gmaps-api-net/\n```\nPS\u003e Install-Package gmaps-api-net\n```\n\n## Overview\nThis 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.\n\n## Notable Upcoming \n* 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!\n* 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](https://github.com/ericnewton76/gmaps-api-net/tree/feat/support-dependency-injection)\n* In relation to above, we will begin removing our tests for specific values, and testing instead for schema changes that Google is pushing through.\n\n## API Support\n\nCurrently the library supports full coverage of the following Google Maps APIs:\n  * Geocoding\n  * Elevation\n  * Static Maps\n  * Directions\n  * Distance Matrix\n  * Places\n  * Time Zones\n  * Street View, added to v0.19\n\n## Quick Examples\nUsing Google Maps API for .NET is designed to be really easy.\n\n### Quick Note about the Google Maps API Key\nGoogle is now requiring a proper API key for accessing the service. Create a key [here](https://developers.google.com/maps/documentation/geocoding/get-api-key), or create/find an existing one in your Google Developers Console.\n\n### Getting an address from the Geocoding service\nLet's suppose we want to search an address and get more information about it. We can write:\n\n```c#\n//always need to use YOUR_API_KEY for requests.  Do this in App_Start.\nGoogleSigned.AssignAllServices(new GoogleSigned(\"YOUR_API_KEY\"));\n\nvar request = new GeocodingRequest();\nrequest.Address = \"1600 Pennsylvania Ave NW, Washington, DC 20500\";\nvar response = new GeocodingService().GetResponse(request);\n\n//The GeocodingService class submits the request to the API web service, and returns the\n//response strongly typed as a GeocodeResponse object which may contain zero, one or more results.\n\n//Assuming we received at least one result, let's get some of its properties:\nif(response.Status == ServiceResponseStatus.Ok \u0026\u0026 response.Results.Count() \u003e 0)\n{\n    var result = response.Results.First();\n\n    Console.WriteLine(\"Full Address: \" + result.FormattedAddress);         // \"1600 Pennsylvania Ave NW, Washington, DC 20500, USA\"\n    Console.WriteLine(\"Latitude: \" + result.Geometry.Location.Latitude);   // 38.8976633\n    Console.WriteLine(\"Longitude: \" + result.Geometry.Location.Longitude); // -77.0365739\n    Console.WriteLine();\n}\nelse\n{\n    Console.WriteLine(\"Unable to geocode.  Status={0} and ErrorMessage={1}\", response.Status, response.ErrorMessage);\n}\n```\n\n### Getting a static map URL\nStatic Maps API support allows you to get a valid url or a streamed bitmap which you can use:\n\n```c#\n//always need to use YOUR_API_KEY for requests.  Do this in App_Start.\nGoogleSigned.AssignAllServices(new GoogleSigned(\"YOUR_API_KEY\"));\nvar map = new StaticMapRequest();\nmap.Center = new Location(\"1600 Pennsylvania Ave NW, Washington, DC 20500\");\nmap.Size = new System.Drawing.Size(400, 400);\nmap.Zoom = 14;\n```\n\nSample for ASP.Net WebForms:\n\n```c#\n//Web Forms: Page method contains above code to create the request\nvar hyperlink = (Hyperlink)Page.FindControl(\"Hyperlink1\");\nhyperlink.NavigateUrl = map.ToUri().ToString();\n```\n\nFor MVC controllers/views:\n\n```c#\n//MVC: controller contains above code to create the request\nViewBag[\"StaticMapUri\"] = map.ToUri();\n\n//MVC: view code\n\u003cimg src=\"@ViewBag[\"StaticMapUri\"]\" alt=\"Static Map Image\" /\u003e\n```\n\nYou can also directly retrieve the bitmap as a byte array (`byte[]`) or as a `Stream`:\n\nFor WPF/xaml applications:\n```c#\n//for WPF:\nBitmapImage img = new BitmapImage();\nimg.SourceStream = staticMapsService.GetStream(staticMapsRequest);\n\nthis.imageControl.Image = img;\n```\n\n### Using a Google Maps for Business key\n\n```c#\n//enterprise users to use your supplied information for requests.  Do this in App_Start.\nGoogleSigned.AssignAllServices(new GoogleSigned(\"gme-your-client-id\", \"your-signing-key\", signType: GoogleSignedType.Business));\n\n// Then do as many requests as you like...\nvar request = new GeocodingRequest();\n//...\nvar response = GeocodingService.GetResponse(request);\n```\n\n### Using a Google Maps API key\n\n```c#\n//always need to use YOUR_API_KEY for requests.  Do this in App_Start.\nGoogleSigned.AssignAllServices(new GoogleSigned(\"your-api-key\"));\n\n// Then do as many requests as you like...\nvar request = new GeocodingRequest();\n//...\nvar response = GeocodingService.GetResponse(request);\n```\n\nYou can also use a particular key for a single request:\n\n```c#\nconst GoogleSigned apikey = new GoogleSigned(\"special_api_key_here\");\nvar request = new GeocodingRequest();\n//...\nvar service = new GeocodingService(request, apikey);\n```\n\n## Contact\nQuestions, comments and/or suggestions are welcome! Please raise an [issue](https://github.com/ericnewton76/gmaps-api-net/issues) in GitHub or send an email to:\n\n- Eric Newton [ericnewton76@gmail.com](mailto:ericnewton76@gmail.com)\n- Richard Thombs [stonyuk@gmail.com](mailto:stonyuk@gmail.com)\n\n## Contributors\nA big thank you to all of our [contributors](https://github.com/ericnewton76/gmaps-api-net/graphs/contributors) including:\n\n- [Eric Newton](https://github.com/ericnewton76)\n- [Sheepzez](https://github.com/Sheepzez)\n- [Mieliespoor](https://github.com/mieliespoor)\n- [Richard Thombs](https://github.com/richardthombs)\n- [Frank Hommers](https://github.com/frankhommers)\n- [Maetiz](https://github.com/Maetiz)\n- [obito1406](https://github.com/obito1406)\n- [pettys](https://github.com/pettys)\n\nForked from a work originally created by [Luis Farzati](https://github.com/luisfarzati) and incorporating ideas from [Brian Pedersen](https://briancaos.wordpress.com/2009/10/16/google-maps-polyline-encoding-in-c)\n\n## A note to Contributors\nIn order to maintain the project files' formatting, please get the EditorConfig plugin that works with your favorite IDE. Many options available.  \n\nThis 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?  :wink:\n\nThe .editorconfig file specifies the desired formatting.  It basically uses an out-of-the-box Visual Studio 2013 C# editor configuration.\n\nAnd to all who contribute... *Thank you!*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericnewton76%2Fgmaps-api-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericnewton76%2Fgmaps-api-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericnewton76%2Fgmaps-api-net/lists"}