ia.GoogleMap Class
Map defines the basic layout behavior of a google map.
Constructor
ia.GoogleMap
-
id -
mapType -
apiKey -
minZoomLevel -
maxZoomLevel -
greyscaleText -
offText
Parameters:
-
idStringThe id of the map.
-
mapTypeStringThe initial map type.
-
apiKeyStringThe api key.
-
minZoomLevelNumberThe min zoom (smaller number).
-
maxZoomLevelNumberThe max zoom (larger number).
-
greyscaleTextStringToolbar greyscale text.
-
offTextStringToolbar off text.
Item Index
Methods
- addEventListener
- addMapOverlay
- adjustBBox
- adjustY
- centerOnFeature
- commitChanges
- dispatchEvent
- extra_zoom
- getBBox
- getDataBBox
- getDataHeight
- getDataPoint
- getDataWidth
- getDataX
- getDataY
- getPixelHeight
- getPixelPoint
- getPixelRect
- getPixelWidth
- getPixelX
- getPixelY
- hwpx
- init
- mapWrapped
- onIAMAPResize
- removeListener
- setBBox
- setMapType
- updateBBox
- updateIAMap
- zoomToFeature
- zoomToFeatures
- zoomToFeatureWithId
- zoomToFeatureWithName
Methods
addEventListener
-
eventType -
fnc -
obj
Add an event listener.
Parameters:
-
eventTypeStringThe type of event to listen for.
-
fncFunctionThe function to call when the event occurs.
-
objObjectAn optional parent object.
adjustBBox
-
bb
Adjusts the bounding box to fit the pixel space whilst maintaining its aspect ratio.
Parameters:
-
bbia.BoundingBoxThe bounding box.
adjustY
-
bb
Adjusts the y coords to fit the pixel space whilst maintaining x coords.
Parameters:
-
bbia.BoundingBoxThe bounding box.
centerOnFeature
-
featureId
Centers a feature on the map.
Parameters:
-
featureIdStringThe id of the feature.
Returns:
commitChanges
()
A call to commitChanges commits any changes made to
canvasWidth, canvasHeight or bBox.
This function exists to allow properties to be changed without continuous updates to the object.
dispatchEvent
-
event
Dispatch an event to the listeners.
Parameters:
-
eventObjectThe event object.
extra_zoom
-
b1 -
b2 -
The
LatLngBounds b1, b2 -> zoom increment.
Parameters:
-
b1google.maps.LatLngBoundsThe first LatLngBounds.
-
b2google.maps.LatLngBoundsThe second LatLngBounds.
-
TheNumberzoom increment.
getDataBBox
-
rect
Converts a rectangle (pixel units) to a bBox (data units).
Parameters:
-
rectia.RectangleA rectangle (pixel units).
Returns:
getDataHeight
-
dimension
Converts a height from pixel units to data units.
Parameters:
-
dimensionNumberA height (pixel units).
Returns:
getDataPoint
-
p
Converts a point from pixel units to data units.
Parameters:
-
pia.PointA point (pixel units).
Returns:
getDataWidth
-
dimension
Converts a width from pixel units to data units.
Parameters:
-
dimensionNumberA width (pixel units).
Returns:
getDataX
-
x
Converts an x-coord from pixel units to data units.
Parameters:
-
xNumberAn x-coord (pixel units).
Returns:
getDataY
-
y
Converts a y-coord from pixel units to data units.
Parameters:
-
yNumberA y-coord (pixel units).
Returns:
getPixelHeight
-
y
Converts a height from data units to pixel units.
Parameters:
-
yNumberA height (data units).
Returns:
getPixelPoint
-
p
Converts a point from data units to pixel units.
Parameters:
-
pia.PointA point (data units).
Returns:
getPixelRect
-
bb
Converts a bounding box (data units) to a rectangle (pixel units).
Parameters:
-
bbia.BoundingBoxA bounding box (data units).
Returns:
getPixelWidth
-
x
Converts a width from data units to pixel units.
Parameters:
-
xNumberA width (data units).
Returns:
getPixelX
-
x
Converts an x-coord from data units to pixel units.
Parameters:
-
xNumberAn x-coord (data units).
Returns:
getPixelY
-
y
Converts a y-coord from data units to pixel units.
Parameters:
-
yNumberA y-coord (data units).
Returns:
hwpx
-
bnds -
A
LatLngBounds bnds -> height and width as a Point
Parameters:
-
bndsgoogle.maps.LatLngBoundsLatLngBounds.
-
Agoogle.maps.Pointgoogle point.
init
()
private
Initialises.
mapWrapped
()
Boolean
private
Checks if the IA map fits inside the google map.
Returns:
onIAMAPResize
()
private
Called when the IA map resizes.
removeListener
-
obj
Removes all event listeners for the given object.
Parameters:
-
objObjectThe object.
setMapType
-
mapType
Sets the map type.
Parameters:
-
mapTypeStringThe mapType.
updateBBox
()
private
Updates the bounding box after the bounds of the google map have changed.
updateIAMap
()
private
Updates the IA map.
zoomToFeature
-
featureId
Zooms to a feature in the map.
Parameters:
-
featureIdStringThe id of the feature.
Returns:
zoomToFeatures
-
featureIds -
optLayers
Zooms to a set of features in the map.
Parameters:
-
featureIdsStringA list of feature ids.
-
optLayersia.LayerBase[]An optional list of layers to check.
zoomToFeatureWithId
-
featureId -
optLayers
Zooms to a feature in the map.
Parameters:
-
featureIdStringThe id of the feature.
-
optLayersia.LayerBase[]An optional list of layers to check.
Returns:
zoomToFeatureWithName
-
featureName -
optLayers
Zooms to a feature in the map with the given name.
Parameters:
-
featureNameStringThe name of the feature.
-
optLayersia.LayerBase[]An optional list of layers to check.
Returns:
Properties
apiKey
String
The google api key.
canvasHeight
Number
The pixel height.
Default: 0
canvasWidth
Number
The pixel width.
Default: 0
canvasX
Number
The pixel x-position.
Default: 0
canvasY
Number
The pixel y-position.
Default: 0
container
JQUERY Element
The container that holds the object.
gMap
google.maps.Map
The google map object.
id
String
The id.
maintainAspectRatio
Boolean
The data space will often be a different shape to the pixel space it has to fill.
If set to true the data space is
adjusted to maintain the aspect ratio.
If set to false the data space stretches
to fit the pixel space. This will generally result
in the aspect ratio changing (a stretching effect).
Default: false
maxZoom
Number
The maximum extent.
Default: -1
minZoom
Number
The minimum extent.
Default: -1