Constructor
new GMaps(options)
- Source:
 
Creates a new GMaps instance, including a Google Maps map.
Parameters:
| Name | Type | Description | 
|---|---|---|
options | 
            
            object | 
 
  | 
        
Members
controls :array
- Source:
 
Collection of custom controls in the map UI
Type:
- array
 
el :HTMLElement
- Source:
 
Container element
Type:
- HTMLElement
 
layers :array
- Source:
 
Collection of KML/GeoRSS and FusionTable layers
Type:
- array
 
map :google.maps.Map
- Source:
 
Google Maps map instance
Type:
- google.maps.Map
 
markerClusterer :object
- Source:
 
Marker Clusterer instance
Type:
- object
 
markers :array
- Source:
 
Collection of map's markers
Type:
- array
 
overlays :array
- Source:
 
Collection of map's overlays
Type:
- array
 
polygons :array
- Source:
 
Collection of map's polygons
Type:
- array
 
polylines :array
- Source:
 
Collection of map's lines
Type:
- array
 
routes :array
- Source:
 
Collection of map's routes requested by GMaps#getRoutes, GMaps#renderRoute, GMaps#drawRoute, GMaps#travelRoute or GMaps#drawSteppedRoute
Type:
- array
 
singleLayers :object
- Source:
 
Collection of data layers (See GMaps#addLayer)
Type:
- object
 
zoom :number
- Source:
 
Current map's zoom
Type:
- number
 
Methods
addControl(options) → {HTMLElement}
- Source:
 
Add a custom control to the map UI.
Parameters:
| Name | Type | Description | 
|---|---|---|
options | 
            
            object | The  
  | 
        
Returns:
- Type
 - HTMLElement
 
fitLatLngBounds(latLngs)
- Source:
 
Adjust the map zoom to include all the coordinates in the latLngs array.
Parameters:
| Name | Type | Description | 
|---|---|---|
latLngs | 
            
            array | Collection of   | 
        
fitZoom()
- Source:
 
Adjust the map zoom to include all the markers added in the map.
getElement() → {HTMLElement}
- Source:
 
Return the HTML element container of the map.
Returns:
the element container.
- Type
 - HTMLElement
 
hideContextMenu()
- Source:
 
Hide the current context menu
refresh()
- Source:
 
Trigger a resize event, useful if you need to repaint the current map (for changes in the viewport or display / hide actions).
removeControl(control) → {HTMLElement}
- Source:
 
Remove a control from the map. control should be a control returned by addControl().
Parameters:
| Name | Type | Description | 
|---|---|---|
control | 
            
            HTMLElement | One of the controls returned by   | 
        
Returns:
the removed control.
- Type
 - HTMLElement
 
setCenter(lat, lng, callbackopt)
- Source:
 
Center the map using the lat and lng coordinates.
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
lat | 
            
            number | Latitude of the coordinate.  | 
        |
lng | 
            
            number | Longitude of the coordinate.  | 
        |
callback | 
            
            function | 
                
                    <optional> | 
            
            
            Callback that will be executed after the map is centered.  | 
        
setContextMenu(options)
- Source:
 
Add a context menu for a map or a marker.
Parameters:
| Name | Type | Description | 
|---|---|---|
options | 
            
            object | The  
  | 
        
zoomIn(magnitudeopt)
- Source:
 
Increase the map's zoom.
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
magnitude | 
            
            number | 
                
                    <optional> | 
            
            
            The number of times the map will be zoomed in.  | 
        
zoomOut(magnitudeopt)
- Source:
 
Decrease the map's zoom.
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
magnitude | 
            
            number | 
                
                    <optional> | 
            
            
            The number of times the map will be zoomed out.  |