background preloader

Maps, Geolocation

Facebook Twitter

Leaflet - a JavaScript library for mobile-friendly maps. Directions Service - Google Maps JavaScript API v3. Overview You can calculate directions (using a variety of methods of transportation) by using the DirectionsService object.

Directions Service - Google Maps JavaScript API v3

This object communicates with the Google Maps API Directions Service which receives direction requests and returns computed results. You may either handle these directions results yourself or use the DirectionsRenderer object to render these results. Directions may specify origins and destinations either as text strings (e.g. "Chicago, IL" or "Darwin, NSW, Australia") or as LatLng values. Directions Requests Accessing the Directions service is asynchronous, since the Google Maps API needs to make a call to an external server. To use directions in V3, create an object of type DirectionsService and call DirectionsService.route() to initiate a request to the Directions service, passing it a DirectionsRequest object literal containing the input terms and a callback method to execute upon receipt of the response.

These fields are explained below: Travel Modes Transit Options. Calculate distance and bearing between two Latitude/Longitude points using Haversine formula in JavaScript. Google maps - How to get all nearby roads in points specified radius? Generate an isochrone map using Google Maps Api. Algorithm - Google Maps: Given a point, how to find all points at a given road distance?

How to calculate the latlng of a point a certain distance away from another? Google Maps Javascript API V3 Reference - Google Maps JavaScript API v3. Release Version Last updated Saturday, January 30, 2016 This reference documents version 3.23 (the release version) of the Maps Javascript API released Nov 19, 2015.

Google Maps Javascript API V3 Reference - Google Maps JavaScript API v3

This release version of the API is a feature-stable version of the API whose interfaces are guaranteed to remain as documented within these pages until this version is retired. To consult the latest (experimental) version of the Maps Javascript API, see the Experimental Development Reference. Map class google.maps.Map class This class extends MVCObject. MapOptions object specification google.maps.MapOptions object specification MapTypeId constants. Events - Google Maps JavaScript API v3. Overview JavaScript within the browser is event driven, meaning that JavaScript responds to interactions by generating events, and expects a program to listen to interesting events.

Events - Google Maps JavaScript API v3

There are two types of events: User events (such as "click" mouse events) are propagated from the DOM to the Google Maps API. These events are separate and distinct from standard DOM events. MVC state change notifications reflect changes in Maps API objects and are named using a property_changed convention. Each Maps API object exports a number of named events. The below sample will show you what events are triggered by the google.maps.Map as you interact with the map. For a complete list of events, consult the Maps API Reference. UI Events Some objects within the Maps API are designed to respond to user events such as mouse or keyboard events. 'click' 'dblclick' 'mouseup' 'mousedown' 'mouseover' 'mouseout' For the full list, see the Marker class.

MVC State Changes MVC objects typically contain state. Reverse Geocoding - Google Maps JavaScript API v3. The Google Geocoding API - Google Maps API Web Services. The Google Maps Geocoding API is a service that provides geocoding and reverse geocoding of addresses.

The Google Geocoding API - Google Maps API Web Services

Geocoding is the process of converting addresses (like a street address) into geographic coordinates (like latitude and longitude), which you can use to place markers on a map, or position the map. Reverse geocoding is the process of converting geographic coordinates into a human-readable address. You can also use the Google Maps Geocoding API to find the address for a given place ID. Sample request and response You access the Google Maps Geocoding API through an HTTP interface. Geocoding request and response (latitude/longitude lookup) The following example requests the latitude and longitude of "1600 Amphitheatre Parkway, Mountain View, CA", and specifies that the output must be in JSON format. You can test this by entering the URL into your web browser (be sure to replace ‘YOUR_API_KEY’ with your actual API key). Below is a sample geocoding response, in JSON: ... ], "status" : "OK"} Quotas. Country Queries.