|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
Object | +--MVMapView
MVMapView is the main entry class for all map operations inside the
web browser. It defines a JavaScript map client instance that fetches and
displays map tile image tiles and features of interest(FOIs) fetched from
the server side, and controls map related client side user interaction.
All map content displayed by the map client is placed inside an HTML DIV element, which defines a rectangular area in the web page that displays the map. The DIV element must be defined in the same HTML page where the map client instance is created. Its size and position can be customized to meet the application's needs.
When the application script invokes appropriate MVMapView methods and other client API, map content is displayed inside the map container DIV. The map client can display 5 different types of map content: map tiles, theme-based FOI, user-defined FOI, information window and map decoration.
Map tiles
A typical Oracle Maps application has at least one map tile layer, which assembles and displays pregenerated map image tiles from the map tile server.
A map tile layer can be added to the map client instance by invoking function MVMapView.addMapTileLayer.
Theme-Based FOI
The application can display one or more theme-based FOI layers. Each theme-based FOI layer consists of a collection of interactive FOIs that meet certain query criteria defined in a MapViewer predefined theme.
A theme-based FOI layer can be added to the map client instance by invoking function MVMapView.addThemeBasedFOI.
User-Defined FOI
The application can display one or more user-defined FOIs. A user defined FOI is a dynamic feature created by the application on the fly. When creating a user defined FOI, the application has to supply all feature attributes including the geometry representation and rendering style. This is different from how the theme based FOI layer is created on the client side. When creating a theme based FOI layer, the application only needs to specify the name of the predefined theme. All feature attributes(spatial or non-spatial) are stored inside the database.
A user-defined FOI can be added to the map client instance by invoking function MVMapView.addFOI.
Information window
An information window is a small pop-up window that displays customizable content in the map.
An Information window can be displayed by invoking function MVMapView.displayInfoWindow.
Fixed figures
Fixed figures are immovable elements such as copyright notes, scale bar, navigation panel and user defined map decoration features. A user defined map decoration feature is an application defined element that can contain any custom HTML content, for example, a map title or a custom control button. Fixed figures are displayed on top of everything else and is not moved when the user drags the map.
Besides displaying the above map content, the application can easily plug in various build-in utilities as needed. Currently supported built-in utilities include: scale bar, navigation tool bar, copyright panel, redlining tool, rectangle tool, marquee zoom tool, overview map, etc. The application can access the a built-in utility by invoking the corresponding MVMapView function. For example, method MVMapView.addScaleBar adds a scale bar to the map.
MVMapView also implements various functions that are essential for map application development. Application can use these functions to: get or change the map center and zoom level, change map client behavior by defining custom event handler for certain events, remove previously added map content, etc.
| Field Summary | |
<static> Object |
extAPITileLayerCount
|
| Constructor Summary | |
MVMapView
(<Object> mapDiv,<string> mapViewerBaseURL)
|
|
| Method Summary | |
void
|
addCircleTool(<MVCircleTool> circleTool)
This method adds an instance of MVCircleTool to the current map. |
void
|
addCopyRightNote( <string> copyright )
This method adds a copyright notice on the bottom right side of the map. |
void
|
addCSTransformFunction(<Object> transformFunction, <int> fromSrid, <int> toSrid)
This function registers a JavaScript function that converts coordinates specified in a coordinate system to coordinates specified in another coordinate system. |
void
|
addDistanceTool(<MVDistanceTool> distanceTool)
This method adds an instance of MVDistanceTool to the current map. |
void
|
addFOI(<object> foi)
This method adds a user-defined FOI to the current map. |
void
|
addMapDecoration(<Object> mapdecoration)
This method adds a MapDecoration object to the map. |
void
|
addMapTileLayer(<object> mapTileLayer, <function> callBack)
This method adds and displays a map tile layer to the map. |
void
|
addNavigationPanel(<string> position, <boolean> panningButtons, <boolean> zoomingBars, <boolean> zoomingButtons, <boolean> zoomLevelBars)
This method creates a map navigation panel and places it on the current map. |
void
|
addOverviewMap(<Object> overviewMap)
This function associates an overview map to the main map displayed by this MVMapView object. |
void
|
addRectangleTool(<MVRectangleTool> rectangleTool)
This method adds an instance of MVRectangleTool to the current map. |
void
|
addRedLineTool(<MVRedlineTool> redlineTool)
This method adds an instance of MVRedlineTool to the current map. |
void
|
addScaleBar(<int> position,<int> hOffset,<int> vOffset,<boolean> transformToGeodetic)
This method adds a scale bar in the current map. |
void
|
addThemeBasedFOI(<Object> themeBasedFOI)
This method adds a theme-based FOI layer to the map. |
void
|
addToolBar(toolBar)
This method adds an instance of MVToolbar to the current map. |
void
|
attachEventListener(type, <string> listener)
This method attaches an event listener function that is invoked when the specified map event occurs. |
void
|
detachEventListener(type, <string> listener)
This method detaches an event listener that has previously been attached to the map by attachEventListener(). |
void
|
display()
This method initializes the map and displays the map content inside the map container (which is an HTML DIV element defined in the web page). |
void
|
displayInfoWindow(<MVSdoGeometry> point, <string> htmlString, <int> width, <int> height, <string> style, <string> title, <Object> styleParameters)
This method displays an information window on the map at a specified location. |
void
|
displayTabbedInfoWindow(<MVSdoGeometry> point, <Array> tabs, <int> activeIndex, <int> width, <int> height, <Object> styleParameters)
This method displays a tabbed information window on the map at a specified location. |
void
|
enableDragging(<boolean> enabled)
This method enables or disables dragging of the current map. |
void
|
enableInfoWindowEventPropagation(<boolean> enabled)
This method enables event propagation from the info window. |
void
|
enableKeyboardPanning(<Boolean> enable)
This methods enables or disables keyboard panning. |
void
|
enableLoadingIcon(enabled)
This methods enables or disables loading icon. |
Object
|
enableMapBoundConstraint(enable)
This method sets whether to enable map bound constraint. |
void
|
enableMapWrapAround(<boolean> enable)
This method sets whether to display the map in the wrap-around manner. |
Array
|
getAllFOIs()
This method gets all user-defined FOI layers in the current map. |
MVSdoGeometry
|
getCenter()
This method gets the center of the current map. |
MVFOI
|
getFOI(<string> id)
This method gets a user-defined FOI object specified by its ID. |
String
|
getMapAsXML(<String> format, <int> width, <int> height)
This method returns the XML map request for the current map. |
MVSdoGeometry
|
getMapCoordinates(<Object> screenXY)
This method converts the location specified by the screen coordinates to the cooresponding location in the map coordinate system. |
void
|
getMapImageURL(<Function> callBack, <String> format, <int> width, <int> height)
This method sends a map request corresponding to the current map view to the MapViewer server and gets the map image URL back from the server. |
void
|
getMapTileLayerDefinition(<Function> callBack, <String> mapTileLayerName, <String> tileServerURL)
This methods gets the map tile layer definition object for a given map tile layer from the map tile server. |
MVSdoGeometry
|
getMapWindowBBox()
This method gets the bounding box of the map window defined in map data coordinate system. |
int
|
getMaxZoomLevel()
This method gets the maximum zoom level of the map. |
MVSdoGeometry
|
getMouseLocation()
This method gets the current mouse location on the current map. |
int
|
getOrigThemeIndex(<MVThemeBasedFOI> themeBasedFOI)
This method gets the original display order of the theme-based FOI layer. |
Object
|
getPixelsPerXUnit()
This method calculate pixels per X unit |
Object
|
getPixelsPerYUnit()
This method calculate pixels per Y unit |
int
|
getSrid()
This method gets the current map spatial reference identifier (coordinate system). |
MVThemeBasedFOI
|
getThemeBasedFOI(<String> layerName)
This method gets a MVThemeBasedFOI object that has been added to the map. |
int
|
getThemeIndex(<object> themeBasedFOI)
This method gets the current display index of the theme-based FOI layer. |
int
|
getZoomLevel()
This method gets the current zoom level of the map. |
void
|
pan(<int> x, <int> y)
This methods pans the map. |
void
|
print(<DIV> printMapDiv)
This method generates a printable map and prints it. |
void
|
removeAllFOIs()
This method removes all user-defined FOIs from the current map. |
void
|
removeFOI(<object> foiOrId)
This method removes a user-defined FOI from the current map. |
Void
|
removeInfoWindow()
This method removes the currently displayed information window. |
void
|
removeMapDecoration(<MVMapDecoration> mapdecoration)
This method removes a map decoration from the current map. |
void
|
removeMapTileLayer(<MVMapTileLayer> mapTileLayer)
This method removes a map tile layer from the map. |
void
|
removeThemeBasedFOI(<MVThemeBasedFOI> themebasedfoi)
This method removes a theme-based FOI layer from the map. |
void
|
setCenter( <MVSdoGeometry> mpoint, <Boolean> noSmoothPanning)
This method sets the center of the current map. |
void
|
setCenterAndZoomLevel(<MVSdoGeometry> center,<int> zoomLevel)
This method sets the map center and zoom level. |
void
|
setCenterMark(<string> img_url, <int> img_width, <int> img_height)
This method displays an image marker at the center of the current map. |
void
|
setDefaultFOIImageFormat(<String> format)
This method sets the image format and background color to be used to render FOI images. |
void
|
setDefaultInfoWindowStyle(<String> style, <Object> styleParameters)
This methods sets the default info window style. |
void
|
setDoubleClickAction(<String> action)
This method will choose whether to recenter or zoomin when the user doubleclicks the mouse on map |
void
|
setEventListener(eventType, listener)
This method is deprecated. |
void
|
setHomeMap(<MVSdoGeometry> center, <int> zoomlevel)
This method sets the home map location and zoom level. |
void
|
setLoadingIconVisible(<Boolean> visible)
This method shows or hides the loading icon. |
void
|
setMouseCursorStyle(<String> cursorStyle, <String> cursorType)
This method sets the mouse cursor style when the mouse is inside the map container and not over any map content other than map tiles. |
void
|
setThemeIndex(<MVThemeBasedFOI> themeBasedFOI, <int> index)
This method sets the display index of the theme-based FOI layer. |
void
|
setToOrigThemeIndex(<MVThemeBasedFOI> themeBasedFOI)
This method sets the display index of the theme-based FOI layer to its original value. |
void
|
setZoomAnimationEnabled(<boolean> enabledOrNot)
This method enables or disables zoom animation. |
void
|
setZoomLevel(<int> zoom)
This method sets the current zoom level of the map. |
void
|
startMarqueeZoom(<String> mode, <Object> rectStyle, <int> minRectSize)
This method, when invoked, allows user to zoom the map by hand drawing a rectangle on the map. |
void
|
stopMarqueeZoom()
This method disables the marquee zoom tool. |
MVSdoGeometry
|
transformGeom(<MVSdoGeometry> geometry, <int> toSrid, <string> mcsURL, <function> callBack, <String> dataSource)
This method transforms the input geometry from one coordinate system to another coordinate system. |
Object
|
wrapAroundLayer(layerwidth)
This method calculate the map is wrap-around in curren map window |
void
|
zoomIn(<MVSdoGeometry> center)
This method zooms the map in by one zoom level. |
void
|
zoomOut(<MVSdoGeometry> center)
This method zooms the map out by one zoom level. |
void
|
zoomToRectangle(<MVSdoGeometry> sdoRectangle)
This method adjusts the map center and zoom level so that the rectangle area specified by an MVSdoGeometry object can best fill the map. |
<static> void
|
addMapTileLayerDefinition(definition)
This method adds an map tile layer configuration entry to the map client. |
<static> void
|
enableCodingHints(<boolean> enabled)
This method enables coding hints that detect potential problems and make suggestions on how to fix them. |
<static> void
|
enableTiming(<boolean> enabled)
This method enables displaying timing measurement as alert message. |
<static> void
|
enableXMLHTTP(<Boolean> enable)
This method sets whether to use browser built-in XMLHttpRequest/XMLHTTP objects to communicate with cross domain remote servers for map and FOI requests. |
<static> void
|
setErrorHandler(<Function> errorHandler)
This method sets the error handler. |
<static> void
|
setProxyPath(<String> proxyPath)
This method sets the path of the proxy server, which is relative to the application domain. |
| Field Detail |
<static> Object extAPITileLayerCount
| Constructor Detail |
MVMapView(<Object> mapDiv,<string> mapViewerBaseURL)
mapDiv - the HTML DIV element where all map content is displayed.
mapViewerBaseURL - the base URL of the MapViewer server from which the map client fetches map tiles and FOI data. The typical MapViewer base URL is http://hostname:port/mapviewer.
| Method Detail |
void addCircleTool(<MVCircleTool> circleTool)
circleTool - an instance of MVCircleTool to be added to the map.
void addCopyRightNote( <string> copyright )
copyright - a string to be displayed as the copyright notice.
void addCSTransformFunction(<Object> transformFunction, <int> fromSrid, <int> toSrid)
transformFunction - : the function used to transform the coordinates. This function takes the X and Y coordinates as the input parameters and returns an object that specifies the result coordinates as attributes x and y.
fromSrid - : the Srid of the coordinate system from which the tranformation function transforms the coordinates.
toSrid - : the Srid of the coordinate system into which the tranformation function transforms the coordinates.
void addDistanceTool(<MVDistanceTool> distanceTool)
distanceTool - an instance of MVDistanceTool to be added to the map.
void addFOI(<object> foi)
foi - FOI object that specifies the user-defined FOI to be added to the map.
void addMapDecoration(<Object> mapdecoration)
The map decoration can be set to collapsible so that it can be minimized when the user clicks on the minimization button. By default, a map decoration is not collapsible.
The map decoration can be set to be draggable so that the user can move the map decoration inside the map window by dragging it using mouse.
mapdecoration - a MapDecoration object to be displayed on the map
void addMapTileLayer(<object> mapTileLayer, <function> callBack)
If the map tile layer is defined on the server(not a MVCustomMapTileLayer object), the map client will automatically fetch the map tile layer definition by sending a request to the map tile server.
mapTileLayer - a MVMapTileLayer, MVCustomMapTileLayer, MVGoogleTileLayer, MVVirtualEarthTileLayer or MVYahooTileLayer object.
callBack - the call back function that is execuated after the map tile layer configuration is fetched from the server and the map tile layer is added.
void addNavigationPanel(<string> position, <boolean> panningButtons, <boolean> zoomingBars, <boolean> zoomingButtons, <boolean> zoomLevelBars)
You can also add the navigation panel by creating a MVNavigationPanel object and adding it to a MVMapDecoration object, which has more control options.
position - that specifies the position of the navigation bar on the map. If its value is west (the default), the navigation panel is placed in the upper left side of the map. If its value is east, the navigation panel is placed in the upper right side of the map.
panningButtons - a boolean that specifies whether to add the panning buttons to the navigation panel.
zoomingBars - a boolean that specifies whether to add the zooming bar to the navigation panel.
zoomingButtons - a boolean that specifies whether to add the zooming buttons(+/-) to the navigation panel.
zoomLevelBars - a boolean that specifies whether to add the zoom level bars to the navigation panel.
void addOverviewMap(<Object> overviewMap)
overviewMap - the MVOverviewMap instance that defines an overview map.
void addRectangleTool(<MVRectangleTool> rectangleTool)
rectangleTool - an instance of MVRectangleTool to be added to the map.
void addRedLineTool(<MVRedlineTool> redlineTool)
redlineTool - an instance of MVRedlineTool to be added to the map.
void addScaleBar(<int> position,<int> hOffset,<int> vOffset,<boolean> transformToGeodetic)
You can also add the scale bar by creating a MVScaleBar object and adding it to a MVMapDecoration object, which has more control options.
position - An integer between 1-4 that specifies the scale bar position, which can be one of the four corners: 1 - Upper-right; 2 - Lower-left; 3 - Lower-right; 4 - Upper-left.
hOffset - An integer that specifies the horizontal offset of the scale bar relative to the right or left border of the map. If the scale bar is placed on the right side of the map, hOffset specifies the offset relative to the right border. If the scale bar is placed on the left side of the map, hOffset specifies the offset relative to the left border.
vOffset - An integer that specifies the vertical offset of the scale bar relative to the upper or lower border of the map. If the scale bar is placed on the upper side of the map, vOffset specifies the offset relative to the upper border. If the scale bar is placed on the lower side of the map, vOffset specifies the offset relative to the lower border.
transformToGeodetic - optional, this parameter tells the map client whether to convert the projected coordinates to geodetic coordinates and calculate the scale bar using sphere surface distances. This parameter should be used only for map images rendered in projected systems.
void addThemeBasedFOI(<Object> themeBasedFOI)
themeBasedFOI - an MVThemeBasedFOI object that defines the theme-based FOI layer.
void addToolBar(toolBar)
toolbar - an instance of MVToolBar to be added to the map.
void attachEventListener(type, <string> listener)
listener - specifying the listener function.
eventType - one of the following string values identifying the type of event listener: MVEvent.RECENTER, MVEvent.MOUSE_CLICK, MVEvent.MOUSE_RIGHT_CLICK, MVEvent.MOUSE_DOUBLE_CLICK, MVEvent.ZOOM_LEVEL_CHANGE, MVEvent.BEFORE_ZOOM_LEVEL_CHANGE and MVEvent.INITIALIZE.
void detachEventListener(type, <string> listener)
listener - specifying the listener function.
eventType - one of the following string values identifying the type of event listener: MVEvent.RECENTER, MVEvent.MOUSE_CLICK, MVEvent.MOUSE_RIGHT_CLICK, MVEvent.MOUSE_DOUBLE_CLICK, MVEvent.ZOOM_LEVEL_CHANGE, MVEvent.BEFORE_ZOOM_LEVEL_CHANGE and MVEvent.INITIALIZE.
void display()
void displayInfoWindow(<MVSdoGeometry> point, <string> htmlString, <int> width, <int> height, <string> style, <string> title, <Object> styleParameters)
point - a point MVSdoGeometry object that specifies the location of the info window on the map, which is defined in the map coordinate system. If the width and height are omitted, the info window will automatically sized to best fit the content.
htmlString - an HTML content string to be displayed inside the information window.
width - the width of the information window in pixels.
height - the height of the information window in pixels.
style - an optional String parameter that specifies the information window style. The possible values are "InfoWindowStyle1" or "InfoWindowStyle2". By default, all information windows are displayed using "InfoWindowStyle1".
title - an optional String parameter that specifies the info window title string.
styleParameters - the object that specifies the custom style parameters, which are effective only when the info window style is "MVInfoWindowStyle1".
void displayTabbedInfoWindow(<MVSdoGeometry> point, <Array> tabs, <int> activeIndex, <int> width, <int> height, <Object> styleParameters)
point - a point MVSdoGeometry object that specifies the location of the info window on the map, which is defined in the map coordinate system. If the width and height are omitted, the info window will automatically sized to best fit the content.
tabs - a MVInfoWindowTab array that specifies each tab's title and content.
activeIndex - It indicates which tab is active. The default value is 0.
width - the width of the information window in pixels.
height - the height of the information window in pixels.
styleParameters - the object that specifies the custom style parameters.
void enableDragging(<boolean> enabled)
enabled - true (enable dragging) or false (disable dragging).
void enableInfoWindowEventPropagation(<boolean> enabled)
enabled - true (enable event propagation) or false (disable event propagation).
void enableKeyboardPanning(<Boolean> enable)
enable - a Boolean that specifies whether to enable keyboard panning, true(enable) or false(disable).
void enableLoadingIcon(enabled)
enable - a Boolean that specifies whether to enable loading icon, true(enable) or false(disable).
Object enableMapBoundConstraint(enable)
void enableMapWrapAround(<boolean> enable)
enable - a boolean value which indicates the map should be displayed in wrap-around manner or not
Array getAllFOIs()
MVSdoGeometry getCenter()
MVFOI getFOI(<string> id)
id - is a string that uniquely identifies the FOI object.
String getMapAsXML(<String> format, <int> width, <int> height)
format - the map image format.
width - the width of the map image. If omitted, the map image width will be set to the width of the current map div container.
height - the height of the map image. If omitted, the map image height will be set to the height of the current map div container.
MVSdoGeometry getMapCoordinates(<Object> screenXY)
screenXY - the screen coordinates specified as an object with x and y attributes.
void getMapImageURL(<Function> callBack, <String> format, <int> width, <int> height)
callBack - the user defined function that is called when the server returns the map image URL. The map image URL is passed as the only parameter to this function.
format - the map image format.
width - the width of the map image. If omitted, the map image width will be set to the width of the current map div container.
height - the height of the map image. If omitted, the map image height will be set to the height of the current map div container.
void getMapTileLayerDefinition(<Function> callBack, <String> mapTileLayerName, <String> tileServerURL)
callBack - is a javascript function that is called after the map tile layer definition is fetched from the server side. The map tile layer definition object is passed as the only parameter to this function.
mapTileLayerName - mapTileLayerName is a string that identifies the map tile layer. It is defined in the form of data-source-name.map-tile-layer-name, where map-tile-layer-name specifies the name of the map tile layer that has been pre-defined on the server side and data-source-name specifies the name of the MapViewer data source in which the map tile layer is defined.
tileServerURL - tileServerURL is a string that specifies the URL of the map tile server, which should be in the form http://host:port/mapviewer/mcserver. This is an optional parameter. When omitted, the map tile server URL is derived from the MapViewer base URL specified when creating the MVMapView object.
MVSdoGeometry getMapWindowBBox()
int getMaxZoomLevel()
MVSdoGeometry getMouseLocation()
int getOrigThemeIndex(<MVThemeBasedFOI> themeBasedFOI)
themeBasedFOI - ThemeBasedFOI is an object that defines the theme-based FOI layer.
Object getPixelsPerXUnit()
Object getPixelsPerYUnit()
int getSrid()
MVThemeBasedFOI getThemeBasedFOI(<String> layerName)
layerName - Theme-based FOI object name.
int getThemeIndex(<object> themeBasedFOI)
themeBasedFOI - themeBasedFOI is the MVThemeBasedFOI object that defines the theme-based FOI layer.
int getZoomLevel()
void pan(<int> x, <int> y)
x - the panning offset in pixels on horizontal direction. A positive value pans the map to the right and a negative value pans the map to the left.
y - the panning offset in pixels on vertical direction. A positive value pans the map downward and a negative value pans the map upward.
void print(<DIV> printMapDiv)
printMapDiv - , a DIV element used to hold the printable map image.
void removeAllFOIs()
void removeFOI(<object> foiOrId)
foiOrId - an FOI object reference or id
Void removeInfoWindow()
void removeMapDecoration(<MVMapDecoration> mapdecoration)
mapdecoration - the MVMapDecoration object to be removed
void removeMapTileLayer(<MVMapTileLayer> mapTileLayer)
mapTileLayer - the MVMapTileLayer object that specifies the map tile layer to be removed.
void removeThemeBasedFOI(<MVThemeBasedFOI> themebasedfoi)
themebasedfoi - the MVThemeBasedFOI object that specifies the theme-based FOI layer to be removed.
void setCenter( <MVSdoGeometry> mpoint, <Boolean> noSmoothPanning)
mpoint - an MVSdoGeometry point object that specifies the map center
noSmoothPanning - whether not to pan the map in a animated sliding manner. True if no smooth panning, false otherwise.
void setCenterAndZoomLevel(<MVSdoGeometry> center,<int> zoomLevel)
center - an MVSdoGeometry point object that specifies the map center.
zoomLevel - an integer that specifies a valid zoom level.
void setCenterMark(<string> img_url, <int> img_width, <int> img_height)
img_url - a string that specifies the URL of the center mark image.
img_width - specifies the width of the image marker.
img_height - specifies the height of the image marker.
void setDefaultFOIImageFormat(<String> format)
The image format can be either png8 or png24. Png8 is faster especially with IE, but it only supports 256 colors and does not support semi-transparency. Png24 supports semi-transparency and much richer colors. The default FOI image format is png24.
The default FOI image format set by this method can be overwritten by MVFOI.setImageFormat() and MVThemeBasedFOI.setImageFormat().
format - the default FOI image format.
void setDefaultInfoWindowStyle(<String> style, <Object> styleParameters)
Here is a usage example.
var parameters = {closeButtonImageURL:"/mapviewer/fsmc/images/infoicons/close_circle.gif",
bodyStyle:"border:2px;border-color:#FF0000;background-color:#FFFFFF",
titleBarStyle:"background-color:#8794A3",
coneStyle:"background-color:#00CCAA;opacity:30",
offset:10} ;
mapview.setDefaultInfoWindowStyle("InfoWindowStyle1", parameters);
style - the name of the info window style. The possible values are "MVInfoWindowStyle1", "MVInfoWindowStyle2" and "MVInfoWindowStyle3".
styleParameters - the object that specifies the custom style parameters.
void setDoubleClickAction(<String> action)
action - it specified the action when the user doubleclicks the mouse on map.If it equals "recenter" the map will move and change the center to the clicked point If it equals "zoomin",the map will zoom in. The default value is "recenter"
void setEventListener(eventType, listener)
void setHomeMap(<MVSdoGeometry> center, <int> zoomlevel)
center - an MVSdoGeometry point object that specifies the home/original center.
zoomlevel - an integer that specifies the home/original zoom level
void setLoadingIconVisible(<Boolean> visible)
visible - a Boolean that specifies whether to show or hide the loading icon, true(show) or false(hide).
void setMouseCursorStyle(<String> cursorStyle, <String> cursorType)
cursorStyle - A string that specifies the cursor style to be used, which must be one of the standard CSS cursor style names such as "crosshair", "pointer" and "move".
cursorType - A string that specifies when the cursor style should be used. Its value can be one of the following: void setThemeIndex(<MVThemeBasedFOI> themeBasedFOI, <int> index)
themeBasedFOI - an MVThemeBasedFOI object that defines the theme-based FOI layer.
index - Display index(1-100)
void setToOrigThemeIndex(<MVThemeBasedFOI> themeBasedFOI)
themeBasedFOI - an MVThemeBasedFOI object that specifies the theme-based FOI layer.
void setZoomAnimationEnabled(<boolean> enabledOrNot)
enabledOrNot - a boolean value which indicates whether or not to enable zoom animation
void setZoomLevel(<int> zoom)
zoom - an integer that specifies the map zoom level.
void startMarqueeZoom(<String> mode, <Object> rectStyle, <int> minRectSize)
var rectStyle = new Object() ; rectStyle.borderColor = "#00FF00" ; rectStyle.borderWidth = 1; rectStyle.borderDashed = true ; rectStyle.fillColor = "#FF0000" ; rectStyle.fillOpacity = 0.5 ;
mode - a String that specifies the mode of the marquee zoom tool. It can be either "one_time" or "continuous". If omitted, the marquee zoom tool is started in "one_time" mode.
rectStyle - an object that specifies the rectangle style. If omitted, the marquee zoom rectangle is drawn in 1) the default style if this method is invoked for the first time, or 2) the style used previously when invoking this method before.
minRectSize - a integer that specifies the minimum effective size of the rectangle in screen pixels. The map is zoomed in only when the user draws a rectangle with both height and width being equal to or larger than the mininum effective size. For example, when minRectSize is 5, a 5x5 rectangle will result in map zooming, while neither a 3x4 nor a 2x10 rectangle will result in map zooming.
void stopMarqueeZoom()
MVSdoGeometry transformGeom(<MVSdoGeometry> geometry, <int> toSrid, <string> mcsURL, <function> callBack, <String> dataSource)
When XMLHTTP/XMLHttpRequest objects are enabled, the request for coordinate system transformation is sent in synchronous mode and the application javascript code following this method call will not be executed until the transformation result is returned from the server. When XMLHTTP/XMLHttpRequest objects are disabled, the request is sent in asynchronous mode without pausing for the server side transformation result. In this case, all application code that depends on the transformation result should be packed into a call back function so that it can be executed only after transformation result is returned. When the call back function is invoked after the result is returned, the transformed geometry is passed into the call back function as the only parameter.
Please refer to enableXMLHTTP() for more information.
geometry - the MVSdoGeometry object to be transformed.
toSrid - that specifies the SRID of the destination coordinate system.
mcsURL - an optional parameter that specifies the URL of the map tile server to be used to perform the coordinate system transformation. If this parameter is omitted, the map tile server associated with the first map tile layer is used.
callBack - the call back function that is execuated after the coordinate system transformation is finished.
dataSource - the name of the mapviewer data source inside which the server side length calculation is to be performed. If omitted, the data source associated with the first map tile layer added is used.
Object wrapAroundLayer(layerwidth)
void zoomIn(<MVSdoGeometry> center)
center - optional, an MVSdoGeometry that specifies the new center of the map after zooming.
void zoomOut(<MVSdoGeometry> center)
center - optional, an MVSdoGeometry that specifies the new center of the map after zooming.
void zoomToRectangle(<MVSdoGeometry> sdoRectangle)
sdoRectangle - an MVSdoGeometry object that specifies the rectangle area to fill the map.
<static> void addMapTileLayerDefinition(definition)
If the map tile layer configuration is added to the map client using this method, the same map tile layer configuration will not be fetched from the server. In other words, using this method, the application can overwrite the map tile layer configuration defined on the server side.
Here is an example.
var mapConfig = {
mapTileLayer:"custom_map",
format:"PNG",
coordSys:{srid:8307,type:"GEODETIC",distConvFactor:0.0,
minX:-180.0,minY:-90.0,maxX:180.0,maxY:90.0},
zoomLevels:
[
{zoomLevel:0,name:"level0",
tileWidth:61.14411263390067, tileHeight:61.14411263390067,
tileImageWidth:256,tileImageHeight:256},
{zoomLevel:1,name:"level1",
tileWidth:30.572056316950334,tileHeight:30.572056316950334,
tileImageWidth:256,tileImageHeight:256},
{zoomLevel:2,name:"level2",
tileWidth:15.286028158107968,tileHeight:15.286028158107968,
tileImageWidth:256,tileImageHeight:256},
{zoomLevel:3,name:"level3",
tileWidth:4.961746909541633,
tileHeight:4.961746909541633,
tileImageWidth:256,tileImageHeight:256},
{zoomLevel:4,name:"level4",
tileWidth:1.6105512127664132,tileHeight:1.6105512127664132,
tileImageWidth:256,tileImageHeight:256},
{zoomLevel:5,name:"level5",
tileWidth:0.5227742142726501,tileHeight:0.5227742142726501,
tileImageWidth:256,tileImageHeight:256},
{zoomLevel:6,name:"level6",
tileWidth:0.16968897570090388,tileHeight:0.16968897570090388,
tileImageWidth:256,tileImageHeight:256},
]
};
<static> void enableCodingHints(<boolean> enabled)
enabled - a boolean that specifies whether to enable coding hints.
<static> void enableTiming(<boolean> enabled)
enabled - a boolean that specifies whether to enable timing.
<static> void enableXMLHTTP(<Boolean> enable)
Web browsers usually do not allow cross-domain AJAX calls, which are remote calls made with XMLHttpRequest/XMLHTTP objects to a remote server in a domain different from the domain where the application web pages are hosted. This requires that all map and FOI requests sent from application web pages must be sent to a MapViewer instance in the same domain, which might be inconvienient or even infeasible for some applications. With Oracle Maps, cross domain remote map and FOI requests can be sent in two different ways: with XMLHttpRequest/XMLHTTP objects enabled or disabled. By default, XMLHttpRequest/XMLHTTP objects are disabled when accessing cross domain remote servers.
When XMLHttpRequest/XMLHTTP objects are enabled, cross domain requests are sent via a proxy server that runs in the application local domain and can forward map and FOI requests to any remote server. The proxy server is provided as part of MapViewer and must be deployed in the application local domain. When XMLHttpRequest/XMLHTTP objects are disabled, cross-domain remote map and FOI requests are sent without using XMLHttpRequest/XMLHTTP objects and therefore can be sent direclty to any remote server in any domain without going through any proxy.
When being sent using browser built-in XMLHttpRequest/XMLHTTP objects, remote requests can be send in both asynchronous and synchronous mode. When being sent without using XMLHttpRequest/XMLHTTP objects, remote requests can be sent only in asynchronous mode. In synchronous mode, the application Javascript code that follows the Oracle Maps Javascript client code that initiates the remote request is not executed until the remote request is sent and the response is received from the remote server. In asynchronous mode, the same application code is always executed immediately after the remote request is sent even before the response from the remote server is received. This can be problemetic when the application code needs to wait for the outcome of the remote request/response. To properly handle such situation, the application should pass a call back function to all Oracle Maps client API methods that make remote AJAX calls and pass result back to the application. The call back function is called once the response is received from the server and should implement the application logic that consumes the result returned from the remote server. The call back function can be used for both synchronous and asynchronous remote reqeusts. Here is the list of all such Oracle Maps client API methods.
enable - A boolean that specifies whether to enable XMLHttpRequest/XMLHTTP objects. Its value can be "true"(enable) or "false"(disable).
<static> void setErrorHandler(<Function> errorHandler)
errorHandler - the javascript function to handle errors.
<static> void setProxyPath(<String> proxyPath)
Take the application with a URL like http://host:port/application_context/application_page for an example, the application domain is host:port, the context root path of the application is application_context. The proxy server must be running inside the same domain and its URL should be something like http://host:port/proxy_context/proxy_server_name, where proxy_context is the context root of the proxy server and proxy_server_name is the name of the proxy server. The relative path of the proxy server is /proxy_context/proxy_server_name. The default path of the proxy server is /mapviewer/proxy, which points to the proxy server shipped with MapViewer.
proxyPath - a String the specifies the relative path of the proxy server objects. Its value can be "true"(enable) or "false"(disable).
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||