Class Index | File Index

Classes


Class eniro.maps.Map


Defined in: Map.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
eniro.maps.Map(mapDiv, opts)
Instantiates a map inside the given container element which is normally a DIV.
Method Summary
Method Attributes Method Name and Description
 
add(control, targetDiv)
Adds the given control to the map.
 
addStickySearch(searchString, options)
Add sticky search
 
fitBounds(bounds)
Sets the map to fit the given bounds.
 
Returns the bounds of the currently shown map.
 
Returns the current center coordinate of the map.
 
Returns the div passed in as map container in the constructor.
 
Returns the current type of map that is display.
 
Returns the current profile.
 
Returns a projection object used to transform coordinates to pixels and back.
 
 
 
 
Returns the zoom level of the map.
 
Tells if this map has focus.
 
Tells if ssl (https) is used
 
panBy(dx, dy)
Changes the center of the map by the given distance in pixels.
 
Pan down
 
Pan left
 
Pan right
 
panTo(latLng)
Changes the center of the map to the given LatLng.
 
Pan up
 
remove(control, targetDiv)
Removes the given control from the map.
 
Remove sticky search
 
setCenter(latLng)
Sets the center of the map.
 
setFocus(focus)
Sets the focus on this map.
 
setMapTypeId(mapTypeId)
Changes the current eniro.maps.MatTypeId.
 
setOptions(opts)
Sets the map options, this can affect what the map is currently displaying.
 
setZoom(zoom)
Sets the zoom level to view the map in.
 
Informs the Map that the Map container has been resized.
Event Summary
Event Attributes Event Name and Description
 
Bounds have changed.
 
Center has changed.
 
Map is clicked.
 
Map type has changed.
 
Mouse moves on map.
 
Map is left by mouse pointer.
 
Map is entered by mouse pointer.
 
Zoom has changed.
Class Detail
eniro.maps.Map(mapDiv, opts)
Instantiates a map inside the given container element which is normally a DIV.
Parameters:
{Node} mapDiv
DOM element to create the map inside.
{MapOptions} opts Optional
Options to control the map.
Method Detail
add(control, targetDiv)
Adds the given control to the map.
Parameters:
{eniro.maps.widget.Control} control
A control.
targetDiv

{Object} addStickySearch(searchString, options)
Add sticky search
Parameters:
{String} searchString
{Object} options
Returns:
{Object} reference that can be used to remove the sticky search

fitBounds(bounds)
Sets the map to fit the given bounds.
Parameters:
{eniro.maps.LatLngBounds} bounds
The bounds to fit the map to.

{eniro.maps.LatLngBounds} getBounds()
Returns the bounds of the currently shown map.
Returns:
{eniro.maps.LatLngBounds} The bounds of the currently show map.

{eniro.maps.LatLng} getCenter()
Returns the current center coordinate of the map.
Returns:
{eniro.maps.LatLng} The current center of the map.

{Node} getMapDiv()
Returns the div passed in as map container in the constructor.
Returns:
{Node} The div passed in as map container in the constructor.

{eniro.maps.MapTypeId} getMapTypeId()
Returns the current type of map that is display.
Returns:
{eniro.maps.MapTypeId} The type of map that is displayed.

{string} getProfile()
Returns the current profile.
Returns:
{string} The current profile.

{eniro.maps.Projection} getProjection()
Returns a projection object used to transform coordinates to pixels and back.
Returns:
{eniro.maps.Projection} An object used to transform pixels <-> coordinates.

getScale()

getScalePostfix()

getScalePostfixNoHyphen()

{number} getZoom()
Returns the zoom level of the map. This is the zoom level displayed to the user, not the internal srs one.
Returns:
{number} The zoom level displayed to the user.

{boolean} hasFocus()
Tells if this map has focus.
Returns:
{boolean} true if focused.

{boolean} isSSL()
Tells if ssl (https) is used
Returns:
{boolean} true if ssl is used.

panBy(dx, dy)
Changes the center of the map by the given distance in pixels. If the change is less than both the width and height of the map, the transition will be smoothly animated.
Parameters:
{number} dx
horizontal pixels
{number} dy
vertical pixels

panDown()
Pan down

panLeft()
Pan left

panRight()
Pan right

panTo(latLng)
Changes the center of the map to the given LatLng. If the change is less than both the width and height of the map, the transition will be smoothly animated.
Parameters:
{eniro.maps.LatLng} latLng
The new center of the map.

panUp()
Pan up

remove(control, targetDiv)
Removes the given control from the map.
Parameters:
{eniro.maps.widget.Control} control
A control.
targetDiv

removeStickySearch(ref)
Remove sticky search
Parameters:
{Object} ref
the sticky search reference returned from "addStickySearch"

setCenter(latLng)
Sets the center of the map.
Parameters:
{eniro.maps.LatLng} latLng
The new center of the map.

setFocus(focus)
Sets the focus on this map.
Parameters:
{boolean} focus
whether the map should have focus.

setMapTypeId(mapTypeId)
Changes the current eniro.maps.MatTypeId. This is used to change what the map is currently displaying.
Parameters:
{eniro.maps.MapTypeId} mapTypeId
The map type to set

setOptions(opts)
Sets the map options, this can affect what the map is currently displaying.
Parameters:
{MapOptions} opts
Options to control the map.

setZoom(zoom)
Sets the zoom level to view the map in. This zoom level is the map displayed zoom level, not the internal srs zoom level.
Parameters:
{number} zoom
Zoom level to set, this is the user displayed zoom.

updateSize()
Informs the Map that the Map container has been resized.
Event Detail
bounds_changed()
Bounds have changed.
eniro.maps.event(map, 'bounds_changed', listener);

center_changed()
Center has changed.
eniro.maps.event(map, 'center_changed', listener);

click()
Map is clicked.
eniro.maps.event(map, 'click', listener);

maptypeid_changed()
Map type has changed.
eniro.maps.event(map, 'maptypeid_changed', listener);
See:
eniro.maps.MapTypeId

mousemove()
Mouse moves on map.
eniro.maps.event(map, 'mousemove', listener);

mouseout()
Map is left by mouse pointer.
eniro.maps.event(map, 'mouseout', listener);

mouseover()
Map is entered by mouse pointer.
eniro.maps.event(map, 'mouseover', listener);

zoom_changed()
Zoom has changed.
eniro.maps.event(map, 'zoom_changed', listener);

Documentation generated by JsDoc Toolkit 2.3.2 on Mon Mar 30 2020 12:10:03 GMT+0200 (CEST)