Map Js
README.md Please note: This repository is not currently maintained, and is kept for historical purpose only. Map Label – A Google Maps JavaScript API utility library A library that adds well-styled, customizable text to a particular location in a Google Maps JavaScript API v3 map. Note that browser support is required for the label to be displayed.
Migrated from the. Live Demo Contributing Want to contribute? Check out the! License Copyright 2014 Google Inc. All rights reserved.
Build Status. This is a library to generate and consume the source map format described here. Use with Node. $ npm install source-map. Use on the Web.. Table of Contents. If you've worked with JavaScript for a little while, you've probably come across two seemingly similar Array methods: Array.prototype.map() and Array.prototype.forEach(). Well, the forEach() method.
Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Map • • • • Controls • • • • • • • • • • • Data • • • • • • • • • • • • • • • • • • • • • • Overlays • • • • • • • • • • • • • • • • • • • • • • • • • • Services • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • Save to Google Maps • Map Types • • • • • • • • Layers • • • • • • • • • • • • • • • • • • • • • Street View • • • • • • • • • • • • • • • • Events • • • • Base • • • • • • MVC • • Geometry Library • • • Places Library • • • • • • • • • • • • • • • • • • • • • • • • • • Drawing Library • • • • • Visualization Library • • •. Pans the map by the minimum amount necessary to contain the given LatLngBounds. It makes no guarantee where on the map the bounds will be, except that as much of the bounds as possible will be visible. The bounds will be positioned inside the area bounded by the map type and navigation (pan, zoom, and Street View) controls, if they are present on the map. If the bounds is larger than the map, the map will be shifted to include the northwest corner of the bounds.
If the change in the map's position is less than both the width and height of the map, the transition will be smoothly animated. Controls the automatic switching behavior for the angle of incidence of the map. The only allowed values are 0 and 45. SetTilt(0) causes the map to always use a 0° overhead view regardless of the zoom level and viewport. SetTilt(45) causes the tilt angle to automatically switch to 45 whenever 45° imagery is available for the current zoom level and viewport, and switch back to 0 whenever 45° imagery is not available (this is the default behavior).
45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note: getTilt returns the current tilt angle, not the value set by setTilt. Because getTilt and setTilt refer to different things, do not bind() the tilt property; doing so may yield unpredictable effects. This setting controls how gestures on the map are handled.
Allowed values: • 'cooperative': Scroll events and one-finger touch gestures scroll the page, and do not zoom or pan the map. Two-finger touch gestures pan and zoom the map. Scroll events with a ctrl key or ⌘ key pressed zoom the map. In this mode the map cooperates with the page. • 'greedy': All touch gestures and scroll events pan or zoom the map. • 'none': The map cannot be panned or zoomed by user gestures.
• 'auto': (default) Gesture handling is either cooperative or greedy, depending on whether the page is scrollable. Controls the automatic switching behavior for the angle of incidence of the map.
The only allowed values are 0 and 45. The value 0 causes the map to always use a 0° overhead view regardless of the zoom level and viewport. The value 45 causes the tilt angle to automatically switch to 45 whenever 45° imagery is available for the current zoom level and viewport, and switch back to 0 whenever 45° imagery is not available (this is the default behavior). 45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note: getTilt returns the current tilt angle, not the value specified by this option.
Because getTilt and this option refer to different things, do not bind() the tilt property; doing so may yield unpredictable effects. ControlPosition constants google.maps. ControlPosition constants Identifiers used to specify the placement of controls on the map. Controls are positioned relative to other controls in the same layout position.
Controls that are added first are positioned closer to the edge of the map. +----------------+ + TL TC TR + + LT RT + + + + LC RC + + + + LB RB + + BL BC BR + +----------------+ Elements in the top or bottom row flow towards the middle of the row. Elements in the left or right column flow towards the middle of the column.
Constant BOTTOM_CENTER Elements are positioned in the center of the bottom row. BOTTOM_LEFT Elements are positioned in the bottom left and flow towards the middle. Elements are positioned to the right of the Google logo. BOTTOM_RIGHT Elements are positioned in the bottom right and flow towards the middle. Elements are positioned to the left of the copyrights. LEFT_BOTTOM Elements are positioned on the left, above bottom-left elements, and flow upwards. LEFT_CENTER Elements are positioned in the center of the left side.
LEFT_TOP Elements are positioned on the left, below top-left elements, and flow downwards. RIGHT_BOTTOM Elements are positioned on the right, above bottom-right elements, and flow upwards. RIGHT_CENTER Elements are positioned in the center of the right side. RIGHT_TOP Elements are positioned on the right, below top-right elements, and flow downwards. TOP_CENTER Elements are positioned in the center of the top row. TOP_LEFT Elements are positioned in the top left and flow towards the middle. TOP_RIGHT Elements are positioned in the top right and flow towards the middle.
Adds a feature to the collection, and returns the added feature. If the feature has an ID, it will replace any existing feature in the collection with the same ID.
If no feature is given, a new feature will be created with null geometry and no properties. If FeatureOptions are given, a new feature will be created with the specified properties.
Note that the IDs 1234 and '1234' are equivalent. Adding a feature with ID 1234 will replace a feature with ID '1234', and vice versa. AddGeoJson(geoJson:Object, options?:). Place information, used to identify and describe the place associated with this Marker. In this context, 'place' means a business, point of interest or geographic location. To allow a user to save this place, open an info window anchored on this marker. The info window will contain information about the place and an option for the user to save it.
Only one of position or place can be specified. Note: The signed-in maps feature is deprecated. Versions 3.27 and earlier of the Google Maps JavaScript API continue to support signed-in maps. A future version will no longer support signed-in maps, and will not support saving a place directly from within your application. Read more about. The format of this attribute depends on the value of the type and follows the w3 AREA coords specification found.
The coords attribute is an array of integers that specify the pixel position of the shape relative to the top-left corner of the target image. The coordinates depend on the value of type as follows: - circle: coords is [x1,y1,r] where x1,y2 are the coordinates of the center of the circle, and r is the radius of the circle. - poly: coords is [x1,y1,x2,y2.xn,yn] where each x,y pair contains the coordinates of one vertex of the polygon. - rect: coords is [x1,y1,x2,y2] where x1,y1 are the coordinates of the upper-left corner of the rectangle and x2,y2 are the coordinates of the lower-right coordinates of the rectangle. InfoWindow class google.maps.
InfoWindow class An overlay that looks like a bubble and is often connected to a marker. This class extends. Constructor InfoWindow(opts?:) Creates an info window with the given options. An InfoWindow can be placed on a map at a particular position or above a marker, depending on what is specified in the options. Unless auto-pan is disabled, an InfoWindow will pan the map to make itself visible when it is opened.
After constructing an InfoWindow, you must call open to display it on the map. The user can click the close button on the InfoWindow to remove it from the map, or the developer can call close() for the same effect. Methods close(). Polygon class google.maps. Polygon class A polygon (like a polyline) defines a series of connected coordinates in an ordered sequence.
Additionally, polygons form a closed loop and define a filled region. See the samples in the developer's guide, starting with a, a, and more. Note that you can also use the to create a polygon. The Data layer offers a simpler way of creating holes because it handles the order of the inner and outer paths for you.
This class extends. Constructor Polygon(opts?:) Create a polygon using the passed, which specify the polygon's path, the stroke style for the polygon's edges, and the fill style for the polygon's interior regions. A polygon may contain one or more paths, where each path consists of an array of LatLngs. You may pass either an array of LatLngs or an of LatLngs when constructing these paths.
Arrays are converted to MVCArrays within the polygon upon instantiation. Methods getDraggable(). The ordered sequence of coordinates that designates a closed loop. Unlike polylines, a polygon may consist of one or more paths. As a result, the paths property may specify one or more arrays of LatLng coordinates.
Paths are closed automatically; do not repeat the first vertex of the path as the last vertex. Simple polygons may be defined using a single array of LatLngs. More complex polygons may specify an array of arrays. Any simple arrays are converted into s. Inserting or removing LatLngs from the MVCArray will automatically update the polygon on the map. OverlayView class google.maps. OverlayView class You can implement this class if you want to display custom types of overlay objects on the map.
Inherit from this class by setting your overlay's prototype: MyOverlay.prototype = new google.maps.OverlayView(). The OverlayView constructor is guaranteed to be an empty function. You must implement three methods: onAdd(), draw(), and onRemove().
• In the onAdd() method, you should create DOM objects and append them as children of the panes. • In the draw() method, you should position these elements. • In the onRemove() method, you should remove the objects from the DOM. You must call setMap() with a valid Map object to trigger the call to the onAdd() method and setMap(null) in order to trigger the onRemove() method.
The setMap() method can be called at the time of construction or at any point afterward when the overlay should be re-shown after removing. The draw() method will then be called whenever a map property changes that could change the position of the element, such as zoom, center, or map type. This class extends. Constructor OverlayView() Creates an OverlayView. Methods draw(). GeocoderStatus constants google.maps. GeocoderStatus constants The status returned by the Geocoder on the completion of a call to geocode().
Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.GeocoderStatus.OK. Constant ERROR There was a problem contacting the Google servers. INVALID_REQUEST This GeocoderRequest was invalid. OK The response contains a valid GeocoderResponse.
OVER_QUERY_LIMIT The webpage has gone over the requests limit in too short a period of time. REQUEST_DENIED The webpage is not allowed to use the geocoder.
UNKNOWN_ERROR A geocoding request could not be processed due to a server error. The request may succeed if you try again.
ZERO_RESULTS No result was found for this GeocoderRequest. GeocoderLocationType constants google.maps. GeocoderLocationType constants Describes the type of location returned from a geocode. Specify these by value, or by using the constant's name. For example, 'ROOFTOP' or google.maps.GeocoderLocationType.ROOFTOP.
Constant APPROXIMATE The returned result is approximate. GEOMETRIC_CENTER The returned result is the geometric center of a result such a line (e.g.
Street) or polygon (region). RANGE_INTERPOLATED The returned result reflects an approximation (usually on a road) interpolated between two precise points (such as intersections).
Interpolated results are generally returned when rooftop geocodes are unavailable for a street address. ROOFTOP The returned result reflects a precise geocode.
TravelMode constants google.maps. TravelMode constants The valid travel modes that can be specified in a DirectionsRequest as well as the travel modes returned in a DirectionsStep. Specify these by value, or by using the constant's name.
For example, 'BICYCLING' or google.maps.TravelMode.BICYCLING. Constant BICYCLING Specifies a bicycling directions request.
DRIVING Specifies a driving directions request. TRANSIT Specifies a transit directions request. WALKING Specifies a walking directions request. TrafficModel constants google.maps. TrafficModel constants The assumptions to use when predicting duration in traffic. Specified as part of a. Specify these by value, or by using the constant's name.
For example, 'bestguess' or google.maps.TrafficModel.BEST_GUESS. Constant BEST_GUESS Use historical traffic data to best estimate the time spent in traffic. OPTIMISTIC Use historical traffic data to make an optimistic estimate of what the duration in traffic will be. PESSIMISTIC Use historical traffic data to make a pessimistic estimate of what the duration in traffic will be. DirectionsStatus constants google.maps. DirectionsStatus constants The status returned by the DirectionsService on the completion of a call to route(). Specify these by value, or by using the constant's name.
For example, 'OK' or google.maps.DirectionsStatus.OK. Constant INVALID_REQUEST The DirectionsRequest provided was invalid. MAX_WAYPOINTS_EXCEEDED Too many DirectionsWaypoints were provided in the DirectionsRequest. See the for the maximum number of waypoints allowed. NOT_FOUND At least one of the origin, destination, or waypoints could not be geocoded. OK The response contains a valid DirectionsResult.
OVER_QUERY_LIMIT The webpage has gone over the requests limit in too short a period of time. REQUEST_DENIED The webpage is not allowed to use the directions service. UNKNOWN_ERROR A directions request could not be processed due to a server error.
The request may succeed if you try again. ZERO_RESULTS No route could be found between the origin and destination. If optimizeWaypoints was set to true, this field will contain the re-ordered permutation of the input waypoints. For example, if the input was: Origin: Los Angeles Waypoints: Dallas, Bangor, Phoenix Destination: New York and the optimized output was ordered as follows: Origin: Los Angeles Waypoints: Phoenix, Dallas, Bangor Destination: New York then this field will be an Array containing the values [2, 0, 1]. Note that the numbering of waypoints is zero-based.
If any of the input waypoints has stopover set to false, this field will be empty, since route optimization is not available for such queries. VehicleType object specification google.maps. VehicleType object specification Possible values for vehicle types. These values are specifed as strings, i.e. 'BUS' or 'TRAIN'.
Constant BUS Bus. CABLE_CAR A vehicle that operates on a cable, usually on the ground.
Aerial cable cars may be of the type GONDOLA_LIFT. COMMUTER_TRAIN Commuter rail. FUNICULAR A vehicle that is pulled up a steep incline by a cable. GONDOLA_LIFT An aerial cable car. HEAVY_RAIL Heavy rail.
HIGH_SPEED_TRAIN High speed train. INTERCITY_BUS Intercity bus. METRO_RAIL Light rail. MONORAIL Monorail. OTHER Other vehicles. SHARE_TAXI Share taxi is a sort of bus transport with ability to drop off and pick up passengers anywhere on its route. Generally share taxi uses minibus vehicles.
SUBWAY Underground light rail. TRAM Above ground light rail. TROLLEYBUS Trolleybus. ElevationStatus constants google.maps.
ElevationStatus constants The status returned by the ElevationService upon completion of an elevation request. Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.ElevationStatus.OK. Constant INVALID_REQUEST This request was invalid.
OK The request did not encounter any errors. OVER_QUERY_LIMIT The webpage has gone over the requests limit in too short a period of time. REQUEST_DENIED The webpage is not allowed to use the elevation service for some reason. UNKNOWN_ERROR A geocoding, directions or elevation request could not be successfully processed, yet the exact reason for the failure is not known. DistanceMatrixStatus constants google.maps. DistanceMatrixStatus constants The top-level status about the request in general returned by the DistanceMatrixService upon completion of a distance matrix request. Specify these by value, or by using the constant's name.
For example, 'OK' or google.maps.DistanceMatrixStatus.OK. Constant INVALID_REQUEST The provided request was invalid.
MAX_DIMENSIONS_EXCEEDED The request contains more than 25 origins, or more than 25 destinations. MAX_ELEMENTS_EXCEEDED The product of origins and destinations exceeds the per-query limit. OK The response contains a valid result. OVER_QUERY_LIMIT Too many elements have been requested within the allowed time period. The request should succeed if you try again after a reasonable amount of time.
REQUEST_DENIED The service denied use of the Distance Matrix service by your web page. UNKNOWN_ERROR A Distance Matrix request could not be processed due to a server error. The request may succeed if you try again. DistanceMatrixElementStatus constants google.maps. DistanceMatrixElementStatus constants The element-level status about a particular origin-destination pairing returned by the DistanceMatrixService upon completion of a distance matrix request. These values are specified as strings, for example, 'OK'.
Constant NOT_FOUND The origin and/or destination of this pairing could not be geocoded. OK The response contains a valid result. ZERO_RESULTS No route could be found between the origin and destination.
StyledMapType class google.maps. StyledMapType class Creates a MapType with a custom style. This class extends.
Constructor StyledMapType(styles:Array, options?:) Creates a styled MapType with the specified options. The StyledMapType takes an array of MapTypeStyles, where each MapTypeStyle is applied to the map consecutively. A later MapTypeStyle that applies the same MapTypeStylers to the same selectors as an earlier MapTypeStyle will override the earlier MapTypeStyle. Methods getTile(tileCoord:, zoom:number, ownerDocument:Document). KmlLayerStatus constants google.maps. KmlLayerStatus constants The status returned by KmlLayer on the completion of loading a document. Specify these by value, or by using the constant's name.
For example, 'OK' or google.maps.KmlLayerStatus.OK. Constant DOCUMENT_NOT_FOUND The document could not be found. Most likely it is an invalid URL, or the document is not publicly available. DOCUMENT_TOO_LARGE The document exceeds the file size limits of KmlLayer. FETCH_ERROR The document could not be fetched. INVALID_DOCUMENT The document is not a valid KML, KMZ or GeoRSS document. INVALID_REQUEST The KmlLayer is invalid.
LIMITS_EXCEEDED The document exceeds the feature limits of KmlLayer. OK The layer loaded successfully.
TIMED_OUT The document could not be loaded within a reasonable amount of time. UNKNOWN The document failed to load for an unknown reason. StreetViewPreference constants google.maps. StreetViewPreference constants Options that bias a search result towards returning a Street View panorama that is nearest to the request location, or a panorama that is considered most likely to be what the user wants to see. Specify these by value, or by using the constant's name. For example, 'best' or google.maps.StreetViewPreference.BEST.
Constant BEST Return the Street View panorama that is considered most likely to be what the user wants to see. The best result is determined by algorithms based on user research and parameters such as recognised points of interest, image quality, and distance from the given location. NEAREST Return the Street View panorama that is the shortest distance from the provided location. This works well only within a limited radius.
The recommended radius is 1km or less. StreetViewSource constants google.maps. StreetViewSource constants Identifiers to limit Street View searches to selected sources. These values are specified as strings.
For example, 'outdoor'. Constant DEFAULT Uses the default sources of Street View, searches will not be limited to specific sources.
OUTDOOR Limits Street View searches to outdoor collections. Indoor collections are not included in search results. Note also that the search only returns panoramas where it's possible to determine whether they're indoors or outdoors. Free Download Program Imagina Espanol Sin Barreras Pdf. For example, PhotoSpheres are not returned because it's unknown whether they are indoors or outdoors.
Autocomplete class google.maps.places. Autocomplete class A service to provide Place predictions based on a user's text input.
It attaches to an input element of type text, and listens for text entry in that field. The list of predictions is presented as a drop-down list, and is updated as text is entered. This class extends. Library places Constructor Autocomplete(inputField:HTMLInputElement, opts?:) Creates a new instance of Autocomplete that attaches to the specified input text field with the given options. Methods getBounds(). Retrieves a list of places near a particular location, based on keyword or type. Location must always be specified, either by passing a LatLngBounds, or location and radius parameters.
The PlaceResults passed to the callback are subsets of the full PlaceResult. Your app can get a more detailed PlaceResult for each place by sending a passing the reference value for the desired place. The PlaceSearchPagination object can be used to fetch additional pages of results (null if this is the last page of results or if there is only one page of results). RadarSearch(request:, callback:function(Array, )). Retrieves a list of places based on a query string (for example, 'pizza in New York', or 'shoe stores near Ottawa').
Location parameters are optional; when the region is specified, results are only biased toward nearby results rather than restricted to places inside the area. Use textSearch when you want to search for places using an arbitrary string, and in cases where you may not want to restrict search results to a particular location. The PlaceSearchPagination object can be used to fetch additional pages of results (null if this is the last page of results or if there is only one page of results). PlacesServiceStatus constants google.maps.places. PlacesServiceStatus constants The status returned by the PlacesService on the completion of its searches. Specify these by value, or by using the constant's name. For example, 'OK' or google.maps.places.PlacesServiceStatus.OK.
Library places Constant INVALID_REQUEST This request was invalid. OK The response contains a valid result.
OVER_QUERY_LIMIT The application has gone over its request quota. REQUEST_DENIED The application is not allowed to use the PlacesService. UNKNOWN_ERROR The PlacesService request could not be processed due to a server error. The request may succeed if you try again. ZERO_RESULTS No result was found for this request. SearchBox class google.maps.places.
SearchBox class A service to provide query predictions based on a user's text input. It attaches to an input element of type text, and listens for text entry in that field. The list of predictions is presented as a drop-down list, and is updated as text is entered. This class extends. Library places Constructor SearchBox(inputField:HTMLInputElement, opts?:) Creates a new instance of SearchBox that attaches to the specified input text field with the given options. Methods getBounds(). DrawingManager class google.maps.drawing.
DrawingManager class Allows users to draw markers, polygons, polylines, rectangles, and circles on the map. The DrawingManager's drawing mode defines the type of overlay that will be created by the user. Adds a control to the map, allowing the user to switch drawing mode. This class extends. Library drawing Constructor DrawingManager(options?:) Creates a DrawingManager that allows users to draw overlays on the map, and switch between the type of overlay to be drawn with a drawing control. Methods getDrawingMode().
OverlayType constants google.maps.drawing. OverlayType constants The types of overlay that may be created by the DrawingManager. Specify these by value, or by using the constant's name. For example, 'polygon' or google.maps.drawing.OverlayType.POLYGON. Library drawing Constant CIRCLE Specifies that the DrawingManager creates circles, and that the overlay given in the overlaycomplete event is a circle. MARKER Specifies that the DrawingManager creates markers, and that the overlay given in the overlaycomplete event is a marker. POLYGON Specifies that the DrawingManager creates polygons, and that the overlay given in the overlaycomplete event is a polygon.
POLYLINE Specifies that the DrawingManager creates polylines, and that the overlay given in the overlaycomplete event is a polyline. RECTANGLE Specifies that the DrawingManager creates rectangles, and that the overlay given in the overlaycomplete event is a rectangle.