new Map(element [, options])
        Base class for maps. Please do not call this constructor directly. Always use createInstance rather than instantiating this class directly. Using createInstance allows this class to be externally extensible.
    
    
    
    
    
    
        Parameters:
| Name | Type | Argument | Description | 
|---|---|---|---|
| element | HTMLElement | to contain map | |
| options | object | <optional> | Options to apply to this map | 
Extends
Methods
- 
    <static> createInstance(element [, options])
- 
    
    Creates an instance of a map, please always use this function rather than calling the constructor directly.Parameters:Name Type Argument Description elementHTMLElement to contain map optionsobject <optional> 
 Options to apply to this map Returns:An instance of WPGMZA.Map- Type
- WPGMZA.Map
 
- 
    <static> getConstructor()
- 
    
    Returns the contructor to be used by createInstance, depending on the selected maps engine.Returns:The appropriate contructor- Type
- function
 
- 
    <static> getGeographicDistance(lat1, lon1, lat2, lon1)
- 
    
    This gets the distance in kilometers between two latitude / longitude points TODO: Move this to the distance class, or the LatLng classParameters:Name Type Description lat1number Latitude from the first coordinate pair lon1number Longitude from the first coordinate pair lat2number Latitude from the second coordinate pair lon1number Longitude from the second coordinate pair Returns:The distance between the latitude and longitudes, in kilometers- Type
- number
 
- 
    _triggerListeners()
- 
    
    Handles the logic of triggering listeners- Inherited From:
 
- 
    addCircle(circle)
- 
    
    Adds the specified circle to this mapParameters:Name Type Description circleWPGMZA.Circle The circle to add Fires:- event:polygonadded
 Throws:Argument must be an instance of WPGMZA.Circle
- 
    addEventListener(type, callback [, thisObject] [, useCapture])
- 
    
    Adds an event listener on this objectParameters:Name Type Argument Description typestring The event type, or multiple types separated by spaces callbackfunction The callback to call when the event fires thisObjectobject <optional> 
 The object to use as "this" when firing the callback useCapturebool <optional> 
 If true, fires the callback on the capture phase, as opposed to bubble phase - Inherited From:
 
- 
    addMarker(marker)
- 
    
    Adds the specified marker to this mapParameters:Name Type Description markerWPGMZA.Marker The marker to add Fires:- event:markeradded
- WPGMZA.Marker#event:added
 Throws:Argument must be an instance of WPGMZA.Marker
- 
    addPolygon(polygon)
- 
    
    Adds the specified polygon to this mapParameters:Name Type Description polygonWPGMZA.Polygon The polygon to add Fires:- event:polygonadded
 Throws:Argument must be an instance of WPGMZA.Polygon
- 
    addPolyline(polyline)
- 
    
    Adds the specified polyline to this mapParameters:Name Type Description polylineWPGMZA.Polyline The polyline to add Fires:- event:polylineadded
 Throws:Argument must be an instance of WPGMZA.Polyline
- 
    deleteCircleByID(id)
- 
    
    Removes a circle by IDParameters:Name Type Description idint The ID of the circle to remove 
- 
    deletePolygon(polygon)
- 
    
    Removes the specified polygon from this mapParameters:Name Type Description polygonWPGMZA.Polygon The polygon to remove Fires:- event:polygonremoved
 Throws:- 
    Argument must be an instance of WPGMZA.Polygon
- 
    Wrong map error
 
- 
    deletePolygonByID(id)
- 
    
    Removes a polygon by IDParameters:Name Type Description idint The ID of the polygon to remove 
- 
    deletePolyline(polyline)
- 
    
    Removes the specified polyline from this mapParameters:Name Type Description polylineWPGMZA.Polyline The polyline to remove Fires:- event:polylineremoved
 Throws:- 
    Argument must be an instance of WPGMZA.Polyline
- 
    Wrong map error
 
- 
    deletePolylineByID(id)
- 
    
    Removes a polyline by IDParameters:Name Type Description idint The ID of the polyline to remove 
- 
    dispatchEvent(event)
- 
    
    Fires an event on this objectParameters:Name Type Description eventstring | WPGMZA.Event Either the event type as a string, or an instance of WPGMZA.Event - Inherited From:
 
- 
    getCircleByID(id)
- 
    
    Gets a circle by IDParameters:Name Type Description idint The ID of the circle to get Returns:The circle, or null if no circle with the specified ID is found- Type
- WPGMZA.Circle | null
 
- 
    getMarkerByID(id)
- 
    
    Gets a marker by IDParameters:Name Type Description idint The ID of the marker to get Returns:The marker, or null if no marker with the specified ID is found- Type
- WPGMZA.Marker | null
 
- 
    getPolygonByID(id)
- 
    
    Gets a polygon by IDParameters:Name Type Description idint The ID of the polygon to get Returns:The polygon, or null if no polygon with the specified ID is found- Type
- WPGMZA.Polygon | null
 
- 
    getPolylineByID(id)
- 
    
    Gets a polyline by IDParameters:Name Type Description idint The ID of the polyline to get Returns:The polyline, or null if no polyline with the specified ID is found- Type
- WPGMZA.Polyline | null
 
- 
    hasEventListener(type)
- 
    
    Test for listeners of type on this objectParameters:Name Type Description typestring The event type to test for - Inherited From:
 Returns:True if this object has listeners bound for the specified type- Type
- bool
 
- 
    loadSettings()
- 
    
    Loads the maps settings and sets some defaults
- 
    nudge(x, y)
- 
    
    Nudges the map viewport by the given pixel coordinatesParameters:Name Type Description xnumber Number of pixels to nudge along the x axis ynumber Number of pixels to nudge along the y axis Throws:Invalid coordinates supplied
- 
    off()
- 
    
    Alias for removeEventListener- Inherited From:
- See:
 
- 
    on()
- 
    
    Alias for addEventListener- Inherited From:
- See:
 
- 
    onBoundsChanged()
- 
    
    Called when the map viewport bounds change. Fires the legacy bounds_changed event.Fires:- event:boundschanged
- event:bounds_changed
 
- 
    onElementResized()
- 
    
    Called when the engine map div is resized
- 
    onIdle()
- 
    
    Called when the map viewport becomes idle (eg movement done, tiles loaded)Fires:- event:idle
 
- 
    onWindowResize()
- 
    
    Called when the window resizes
- 
    removeCircle(circle)
- 
    
    Removes the specified circle from this mapParameters:Name Type Description circleWPGMZA.Circle The circle to remove Fires:- event:circleremoved
 Throws:- 
    Argument must be an instance of WPGMZA.Circle
- 
    Wrong map error
 
- 
    removeEventListener(type [, listener] [, thisObject] [, useCapture])
- 
    
    Removes event listeners from this objectParameters:Name Type Argument Description typestring The event type to remove listeners from listenerfunction <optional> 
 The function to remove. If omitted, all listeners will be removed thisObjectobject <optional> 
 Use the parameter to remove listeners bound with the same thisObject useCapturebool <optional> 
 Remove the capture phase event listener. Otherwise, the bubble phase event listener will be removed. - Inherited From:
 
- 
    removeMarker(marker)
- 
    
    Removes the specified marker from this mapParameters:Name Type Description markerWPGMZA.Marker The marker to remove Fires:- event:markerremoved
- WPGMZA.Marker#event:removed
 Throws:- 
    Argument must be an instance of WPGMZA.Marker
- 
    Wrong map error
 
- 
    removeMarkerByID(id)
- 
    
    Removes a marker by IDParameters:Name Type Description idint The ID of the marker to remove Fires:- event:markerremoved
- WPGMZA.Marker#event:removed
 
- 
    setCenter(latLng)
- 
    
    Centers the map on the supplied latitude and longitudeParameters:Name Type Description latLngobject | WPGMZA.LatLng A LatLng literal or an instance of WPGMZA.LatLng 
- 
    setDimensions(width, height)
- 
    
    Sets the dimensions of the map engine elementParameters:Name Type Description widthnumber Width as a CSS string heightnumber Height as a CSS string 
- 
    setOptions()
- 
    
    Sets options in bulk on map
- 
    trigger()
- 
    
    Alias for removeEventListener- Inherited From:
- See: