Difference between revisions of "Linden Lab Official:Map API Reference"

From Second Life Wiki
Jump to navigation Jump to search
Line 21: Line 21:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
addMapWindow(  
addMapWindow(  
MapWindow mapWindow,  
MapWindow mapWindow,  
Line 29: Line 29:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
addMarker(
addMarker(
Marker marker,  
Marker marker,  
Line 37: Line 37:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
clickMarker(
clickMarker(
Marker marker)  
Marker marker)  
Line 44: Line 44:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
disableDragging()
disableDragging()
|valign="top"| None
|valign="top"| None
Line 50: Line 50:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
enableDragging()
enableDragging()
|valign="top"| None
|valign="top"| None
Line 57: Line 57:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
enterAndZoomAtSLCoord(  
enterAndZoomAtSLCoord(  
XYPoint coordinate,  
XYPoint coordinate,  
Line 65: Line 65:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
getCurrentZoomLevel()
getCurrentZoomLevel()
|valign="top"| None
|valign="top"| None
Line 71: Line 71:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
getMapCenter()  
getMapCenter()  
|valign="top"|XYPoint
|valign="top"|XYPoint
Line 77: Line 77:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
getViewportBounds()  
getViewportBounds()  
|valign="top"|Bounds
|valign="top"|Bounds
Line 83: Line 83:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
panDown()  
panDown()  
|valign="top"| None
|valign="top"| None
Line 89: Line 89:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
panLeft()
panLeft()
|valign="top"| None
|valign="top"| None
Line 95: Line 95:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
panOrRecenterToSLCoord(
panOrRecenterToSLCoord(
XYPoint coord,  
XYPoint coord,  
Line 103: Line 103:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
panRight()
panRight()
|valign="top"| None
|valign="top"| None
Line 109: Line 109:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
panUp()
panUp()
|valign="top"| None
|valign="top"| None
Line 115: Line 115:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
removeAllMarkers()   
removeAllMarkers()   
|valign="top"| None
|valign="top"| None
Line 121: Line 121:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
removeMarker(
removeMarker(
Marker marker)   
Marker marker)   
Line 128: Line 128:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
setCurrentZoomLevel(
setCurrentZoomLevel(
int zoom)  
int zoom)  
Line 135: Line 135:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
zoomIn()  
zoomIn()  
|valign="top"| None
|valign="top"| None
Line 141: Line 141:


|-
|-
|valign="top" style="signature"|
|valign="top" class="signature"|
zoomOut()
zoomOut()
|valign="top"| None
|valign="top"| None
|valign="top"| Zooms out on the map if the map is not already all the way zoomed out.  
|valign="top"| Zooms out on the map if the map is not already all the way zoomed out.  
|}
|}

Revision as of 17:11, 22 January 2009

SLMap

This class represents the map.

Constructor

Constructor

SLMap ( HTMLElement container, SLMapOptions options )

Creates the map. The SLMapOptions argument is optional.

Methods

Method Return Value Description

addMapWindow( MapWindow mapWindow, XYPoint coord )

None Adds a MapWindow to the map at specified coordinate.

addMarker( Marker marker, MapWindow mapWindow )

None Adds a marker. If the optional mapWindow argument is null, then clicking on the marker will not open a window.

clickMarker( Marker marker)

None Simulates a clicking a marker. Will recenter the pan if its not currently in the viewport of the map.

disableDragging()

None Disables all dragging on the map. Note: panning controls will still work.

enableDragging()

None Re-enables dragging on the map if it was disabled.


enterAndZoomAtSLCoord( XYPoint coordinate, int zoom)

None Centers and zooms the map to the specified location.

getCurrentZoomLevel()

None Gets the current zoom level (1-6). See about zoom levels.

getMapCenter()

XYPoint Returns the current map center. See about coordinates.

getViewportBounds()

Bounds Gets the viewport bounds. See about coordinates.

panDown()

None Pans the map to the down by half its width.

panLeft()

None Pans the map to the left by 1/2 its width.

panOrRecenterToSLCoord( XYPoint coord, Boolean recenter )

None Pans the map to the given coordinate if it is currently in the viewport (in the user's view). Otherwise, recenters the map to the given coordinate. The optional recenter argument specifies whether to center the given coordinate even it if is currently in the viewport. Its default value is false.

panRight()

None Pans the map to the right by 1/2 its width.

panUp()

None Pans the map to the up by 1/2 its width.

removeAllMarkers()

None Removes all markers.

removeMarker( Marker marker)

None Removes a marker.

setCurrentZoomLevel( int zoom)

None Sets the zoom level to specified zoom.

zoomIn()

None Zooms in on the map if the map is not already all the way zoomed in.

zoomOut()

None Zooms out on the map if the map is not already all the way zoomed out.