Class 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.
Constructor Attributes | Constructor Name and Description |
---|---|
MVMapView(mapDiv, mapViewerBaseURL)
|
Method Attributes | Method Name and Description |
---|---|
addCircleTool(circleTool)
This method adds an instance of MVCircleTool to the current map.
|
|
addCopyRightNote(copyright, options)
This method adds a copyright notice on the bottom right side of the map.
|
|
addCSTransformFunction(transformFunction:, fromSrid:, toSrid:)
This function registers a JavaScript function that converts coordinates specified
in a coordinate system to coordinates specified in another coordinate system.
|
|
addDistanceTool(distanceTool)
This method adds an instance of MVDistanceTool to the current map.
|
|
addFOI(foi)
This method adds a user-defined FOI to the current map.
|
|
addFOIGroup(group)
This method adds a MVFOIGroup object to the MVMapView instance.
|
|
addMapDecoration(mapdecoration)
This method adds a MapDecoration object to the map.
|
|
addMapTileLayer(mapTileLayer, callBack)
This method adds and displays a map tile layer to the map.
|
|
<static> |
MVMapView.addMapTileLayerDefinition(definition)
This method adds an map tile layer configuration entry to the map client.
|
addNavigationPanel(position, panningButtons, zoomingBars, zoomingButtons, zoomLevelBars)
This method creates a map navigation panel and places it on the current map.
|
|
addOverviewMap(overviewMap)
This function associates an overview map to the main map displayed by this
MVMapView object.
|
|
addRectangleTool(rectangleTool)
This method adds an instance of MVRectangleTool to the current map.
|
|
addRedLineTool(redlineTool)
This method adds an instance of MVRedlineTool to the current map.
|
|
addScaleBar(position, hOffset, vOffset, transformToGeodetic)
This method adds a scale bar in the current map.
|
|
addThemeBasedFOI(themeBasedFOI)
This method adds a theme-based FOI layer to the map.
|
|
addToolBar(toolbar)
This method adds an instance of MVToolbar to the current map.
|
|
attachEventListener(eventType, listener)
This method attaches an event listener function that is invoked when the specified map event occurs.
|
|
detachEventListener(eventType, listener)
This method detaches an event listener that has previously been attached to the map by #attachEventListener.
|
|
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).
|
|
displayInfoWindow(point, htmlString, width, height, style, title, styleParameters)
This method displays an information window on the map at a specified location.
|
|
displayTabbedInfoWindow(point, tabs, activeIndex, width, height, styleParameters)
This method displays a tabbed information window on the map at a specified location.
|
|
<static> |
MVMapView.enableCodingHints(enabled)
This method enables coding hints that detect potential problems and make suggestions
on how to fix them.
|
enableDragging(enabled)
This method enables or disables dragging of the current map.
|
|
enableInfoWindowEventPropagation(enabled)
This method enables event propagation from the info window.
|
|
enableKeyboardPanning(enable)
This methods enables or disables keyboard panning.
|
|
enableLoadingIcon(enable)
This methods enables or disables loading icon.
|
|
enableMapBoundConstraint(enable)
This method sets whether to enable map bound constraint.
|
|
enableMapWrapAround(enable)
This method sets whether to display the map in the wrap-around manner.
|
|
enableMouseWheelZooming(enabled)
This method enables or disables mouse wheel zooming.
|
|
<static> |
MVMapView.enableTiming(enabled)
This method enables displaying timing measurement as alert message.
|
<static> |
MVMapView.enableXMLHTTP(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.
|
This method gets all user-defined FOI layers in the current map.
|
|
This method gets the center of the current map.
|
|
This method gets the copyright text string currently displayed on the map.
|
|
getFOI(id)
This method gets a user-defined FOI object specified by its ID.
|
|
getMapAsXML(format, width, height)
This method returns the XML map request for the current map.
|
|
This method gets the map tile layer configuration object.
|
|
getMapCoordinates(screenXY)
This method converts the location specified by the screen coordinates to the cooresponding location
in the map coordinate system.
|
|
getMapImageURL(callBack, format, width, 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.
|
|
getMapTileLayerDefinition(callBack, mapTileLayerName, tileServerURL)
This methods gets the map tile layer definition object for a given map tile
layer from the map tile server.
|
|
This method gets all map tile layers that have been added to the map.
|
|
This method gets the bounding box of the map window defined in map data coordinate system.
|
|
This method gets the maximum zoom level of the map.
|
|
This method gets the current mouse location on the current map.
|
|
getOrigThemeIndex(themeBasedFOI)
This method gets the original display order of the theme-based FOI layer.
|
|
This method calculate pixels per X unit
|
|
This method calculate pixels per Y unit
|
|
getSrid()
This method gets the current map spatial reference identifier (coordinate system).
|
|
getThemeBasedFOI(layerName)
This method gets a MVThemeBasedFOI object that has been added to the map.
|
|
This method gets all MVThemeBasedFOI objects that have been added to the map.
|
|
getThemeIndex(themeBasedFOI)
This method gets the current display index of the theme-based FOI layer.
|
|
This method gets the current zoom level of the map.
|
|
origWindowOnkeydownListener(_event)
|
|
origWindowOnkeyupListener(_event)
|
|
origWindowOnmouseupListener(_event)
|
|
origWindowOnResizeListener(_event)
|
|
pan(x, y)
This methods pans the map.
|
|
print(printMapDiv,)
This method generates a printable map and prints it.
|
|
This method removes all user-defined FOIs from the current map.
|
|
removeFOI(foiOrId)
This method removes a user-defined FOI from the current map.
|
|
This method removes the currently displayed information window.
|
|
removeMapDecoration(mapdecoration)
This method removes a map decoration from the current map.
|
|
removeMapTileLayer(mapTileLayer)
This method removes a map tile layer from the map.
|
|
removeThemeBasedFOI(themebasedfoi)
This method removes a theme-based FOI layer from the map.
|
|
setCenter(mpoint, noSmoothPanning)
This method sets the center of the current map.
|
|
setCenterAndZoomLevel(center, zoomLevel)
This method sets the map center and zoom level.
|
|
setCenterMark(img_url, img_width, img_height)
This method displays an image marker at the center of the current map.
|
|
setDefaultFOIImageFormat(format)
This method sets the image format and background color to be used to render
FOI images.
|
|
setDefaultInfoWindowStyle(style, styleParameters)
This methods sets the default info window style.
|
|
setDoubleClickAction(action)
This method will choose whether to recenter or zoomin when the user doubleclicks the mouse on map
|
|
<static> |
MVMapView.setErrorHandler(errorHandler)
This method sets the global error handler that is invoked when an error occurs.
|
setErrorHandler(errorHandler)
This method sets the instance specific error handler.
|
|
setEventListener(eventType, listener)
This method is deprecated.
|
|
setHomeMap(center, zoomlevel)
This method sets the home map location and zoom level.
|
|
setLoadingIconVisible(visible)
This method shows or hides the loading icon.
|
|
<static> |
MVMapView.setLocale(language, country)
This method sets the Oracle Maps client locale, in which all client side error messages
and into tips for built-in utilities are displayed.
|
setMouseCursorStyle(cursorStyle, 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.
|
|
<static> |
MVMapView.setProxyPath(proxyPath)
This method sets the path of the proxy server, which is relative to the application
domain.
|
setThemeIndex(themeBasedFOI, index)
This method sets the display index of the theme-based FOI layer.
|
|
setToOrigThemeIndex(themeBasedFOI)
This method sets the display index of the theme-based FOI layer to its original value.
|
|
<static> |
MVMapView.setUtilImgURL(url)
This method sets the base URL of the UI utility images.
|
setZoomAnimationEnabled(enabledOrNot)
This method enables or disables zoom animation.
|
|
setZoomLevel(zoom)
This method sets the current zoom level of the map.
|
|
startMarqueeZoom(mode, rectStyle, minRectSize)
This method, when invoked, allows user to zoom the map by hand drawing a
rectangle on the map.
|
|
This method disables the marquee zoom tool.
|
|
transformGeom(geometry, toSrid, mcsURL, callBack, dataSource)
This method transforms the input geometry from one coordinate system to another
coordinate system.
|
|
wrapAroundLayer(layerwidth)
This method calculate the map is wrap-around in curren map window
|
|
zoomIn(center)
This method zooms the map in by one zoom level.
|
|
zoomOut(center)
This method zooms the map out by one zoom level.
|
|
zoomToRectangle(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.
|
- Parameters:
- {Object} mapDiv
- the HTML DIV element where all map content is displayed.
- {string} 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.
- Parameters:
- {MVCircleTool} circleTool
- an instance of MVCircleTool to be added to the map.
- Returns:
- None
- Requires:
- MVCircleTool
- See:
- MVCircleTool
The options object can have the following attributes:
- left: This attribute specifies the horizontal position of the copyright node relative to the upper-left corner from the map. It should be a float number in the range of 0 to 1. The absolute position in pixels is left*map_window_width + xOffset.
- top: This attribute specifies the vertical position of the copyright node relative to the upper-left corner from the map. It should be a float number in the range of 0 to 1. The absolute position in pixels is top*map_window_height + yOffset.
- xOffset: This attribute specifies the horizontal offset in pixels. It should be an integer.
- yOffset: This attribute specifies the vertical offset in pixels. It should be an integer.
- style: This attribute specifies the CSS style of the copyright note. It should be a string, e.g. "color:#0000FF;font-family:Arial;font-size:12;font-weight:bold".
You can also specify the font type, color and size of the copyright note by defining your own CSS style. The CSS style must be named .MV_COPYRIGHT. Here is an example.
<style type="text/css"> .MV_COPYRIGHT{ font-family: Arial; font-weight:bold; color: #FF0000; } </style>
- Parameters:
- {string} copyright
- a string to be displayed as the copyright notice.
- {Object} options
- an object that specifies positioning and/or styling parameters.
- Returns:
- None
- Parameters:
- {Object} 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.
- {int} fromSrid:
- the Srid of the coordinate system from which the tranformation function transforms the coordinates.
- {int} toSrid:
- the Srid of the coordinate system into which the tranformation function transforms the coordinates.
- Parameters:
- {MVDistanceTool} distanceTool
- an instance of MVDistanceTool to be added to the map.
- Returns:
- None
- Requires:
- MVDistanceTool
- See:
- MVDistanceTool
- Parameters:
- {object} foi
- FOI object that specifies the user-defined FOI to be added to the map.
- Returns:
- None
- Parameters:
- {Object} group
- a FOI group object
- Returns:
- None
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.
- Parameters:
- {Object} mapdecoration
- a MapDecoration object to be displayed on the map
- Returns:
- None
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.
- Parameters:
- {object} mapTileLayer
- a MVMapTileLayer, MVCustomMapTileLayer, MVGoogleTileLayer, MVVirtualEarthTileLayer or MVYahooTileLayer object.
- {function} 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.
- Returns:
- None
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}, ] };
- Attribute "dataSource" specifies the name of the data source where the map tile layer configuration is defined. This attribute can be omitted if the map tile layer configuration is defined for a custom map tiles layer.
- Attribute "mapTileLayer" specifies the name of the map tile layer or custom map tiles layer.
- Attribute "format" specifies tile image format.
- Attribute "coordSys" specifies the map coordinate system, which is specified
as an object with the following attributes.
- Attribute "srid" specifies the spatial reference ID of the coordinate system.
- Attribute "type" specifies the type of the coordinate system, which can be "GEODETIC", "PROJECTED" or "LOCAL"
- Attribute "distConvFactor" specifies the distance unit conversion factor that can be used to convert distance specified in coordinate system units into distance specified in meters. distConvFactor * [distance in coordinate system units] = [distance in meters] It should be set to 0 if the direct/linear distance conversion is not feasible, e.g., all "GEODETIC" coordinate systems.
- Attribute "minX" specifies the lower X bound of the coordinate system, which should be the minimum X coordinate value of left-most tiles in the map coordinate system.
- Attribute "minY" specifies the lower Y bound of the coordinate system, which should be the minimum Y coordinate value of the bottom-most tiles in the map coordinate system.
- Attribute "maxX" specifies the upper X bound of the coordinate system, which should be the maximum X coordinate value of the right-most tiles in the map coordinate system.
- Attribute "maxY" specifies the upper Y bound of the coordinate system, which should be the maximum Y coordinate value of the top-most tiles in the map coordinate system.
- Attribute "zoomLevels" specifies the predefined zoom levels with tiling rules,
which is specifies as an array. Each element of this array specifies the defintion
of one zoom level. The zoom levels are ordered from level 0 to level n-1, where
level 0 is the most zoomed out level and level n-1 is the most zoomed in level.
Each zoom level element is specified as an object with the following attributes.
- Attribute "zoomLevel" specifies zoom level number.
- Attribute "name" specifies the name of the zoom level.
- Attribute "tileWidth" specifies the width of the map tile defined in map coordinate system units.
- Attribute "tileHeight" specifies the height of the map tile defined in map coordinate system units.
- Attribute "tileImageWidth" specifies the width of the map tile image in screen pixels.
- Attribute "tileImageHeight" specifies the height of the map tile image in screen pixels.
- Parameters:
- definition
You can also add the navigation panel by creating a MVNavigationPanel object and adding it to a MVMapDecoration object, which has more control options.
- Parameters:
- {string} 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.
- {boolean} panningButtons
- a boolean that specifies whether to add the panning buttons to the navigation panel.
- {boolean} zoomingBars
- a boolean that specifies whether to add the zooming bar to the navigation panel.
- {boolean} zoomingButtons
- a boolean that specifies whether to add the zooming buttons(+/-) to the navigation panel.
- {boolean} zoomLevelBars
- a boolean that specifies whether to add the zoom level bars to the navigation panel.
- Returns:
- None
- Parameters:
- {Object} overviewMap
- the MVOverviewMap instance that defines an overview map.
- Returns:
- None.
- Parameters:
- {MVRectangleTool} rectangleTool
- an instance of MVRectangleTool to be added to the map.
- Returns:
- None
- Requires:
- MVRectangleTool
- See:
- MVRectangleTool
- Parameters:
- {MVRedlineTool} redlineTool
- an instance of MVRedlineTool to be added to the map.
- Returns:
- None
- Requires:
- MVRedlineTool
- See:
- MVRedlineTool
You can also add the scale bar by creating a MVScaleBar object and adding it to a MVMapDecoration object, which has more control options.
- Parameters:
- {int} 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.
- {int} 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.
- {int} 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.
- {boolean} 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.
- Returns:
- None
- Parameters:
- {Object} themeBasedFOI
- an MVThemeBasedFOI object that defines the theme-based FOI layer.
- Returns:
- None
- Parameters:
- {MVToolBar} toolbar
- an instance of MVToolBar to be added to the map.
- Returns:
- None
- Requires:
- MVToolBar
- See:
- MVToolBar
- A MVEvent.RECENTER event occurs when the center of the map is changed, which can happen when the user drags the map or uses the navigation panel to pan the map. No parameter is passed to the MVEvent.RECENTER listener when it is invoked.
- A MVEvent.MOUSE_CLICK event occurs when the user clicks mouse left key on the map. The mouse event object is passed to the MVEvent.MOUSE_CLICK listener when it is invoked.
- A MVEvent.MOUSE_RIGHT_CLICK event occurs when the user clicks mouse right key on the map. The mouse event object is passed to the MVEvent.MOUSE_RIGHT_CLICK listener when it is invoked.
- A MVEvent.MOUSE_DOUBLE_CLICK event occurs when the user double clicks mouse left key on the map. The mouse event object is passed to the MVEvent.MOUSE_DOUBLE_CLICK listener when it is invoked.
- A MVEvent.ZOOM_LEVEL_CHANGE event occurs after the map zoom level is changed. Two parameters are passed to the MVEvent.ZOOM_LEVEL_CHANGE listener when it is invoked. The first parameter specifies the map zoom level before the zoom level change and the second parameter specifies the map zoom level after the zoom level change.
- A MVEvent.BEFORE_ZOOM_LEVEL_CHANGE event occurs before the map zoom level is changed. Two parameters are passed to the MVEvent.BEFORE_ZOOM_LEVEL_CHANGE listener when it is invoked. The first parameter specifies the map zoom level before the zoom level change and the second parameter specifies the map zoom level after the zoom level change.
- An MVEvent.INITIALIZE event occurs right after the #display method is called and the map is initialized and displayed for the first time. No parameter is passed to this listener.
- Parameters:
- {string} 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.
- {string} listener
- specifying the listener function.
- Returns:
- None
- Parameters:
- {string} 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.
- {string} listener
- specifying the listener function.
- Returns:
- None
- Returns:
- None
- Parameters:
- {MVSdoGeometry} 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.
- {string} htmlString
- an HTML content string to be displayed inside the information window.
- {int} width
- the width of the information window in pixels.
- {int} height
- the height of the information window in pixels.
- {string} 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".
- {string} title
- an optional String parameter that specifies the info window title string.
- {Object} styleParameters
- the object that specifies the custom style parameters, which are effective only when the info window style is "MVInfoWindowStyle1".
- Returns:
- None
- Parameters:
- {MVSdoGeometry} 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.
- {Array} tabs
- a MVInfoWindowTab array that specifies each tab's title and content.
- {int} activeIndex
- It indicates which tab is active. The default value is 0.
- {int} width
- the width of the information window in pixels.
- {int} height
- the height of the information window in pixels.
- {Object} styleParameters
- the object that specifies the custom style parameters.If the value of attribute named tabStyle is "p", tab style will be in partial model which means some tabs may be truncated if they are too long. When the value is "f", tabs will be in full model which means every tabs are full shown.
- Returns:
- None
- Parameters:
- {boolean} enabled
- a boolean that specifies whether to enable coding hints.
- Returns:
- None
- Parameters:
- {boolean} enabled
- true (enable dragging) or false (disable dragging).
- Returns:
- None
- Parameters:
- {boolean} enabled
- true (enable event propagation) or false (disable event propagation).
- Returns:
- None
- Parameters:
- {Boolean} enable
- a Boolean that specifies whether to enable keyboard panning, true(enable) or false(disable).
- Parameters:
- {Boolean} enable
- a Boolean that specifies whether to enable loading icon, true(enable) or false(disable).
- Returns:
- None
- Parameters:
- enable
All vector theme types, except heatmap theme, can be displayed as a theme based FOI layer in wrap-around mode.
- Parameters:
- {boolean} enable
- a boolean value which indicates the map should be displayed in wrap-around manner or not
- Returns:
- None
- Parameters:
- {boolean} enabled
- a boolean that specifies whether to enable mouse wheel zooming.
- Returns:
- None
- Parameters:
- {boolean} enabled
- a boolean that specifies whether to enable timing.
- Returns:
- None
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.
- MVMapView.transformGeom
This method invokes remote server side function to perform coordinate system transformation. - MVSdoGeometry.getLength
This method invokes remote server side function to calculate the length of a geometry. - MVSdoGeometry.getArea
This method invokes remote server side function to calculate the area of a geometry.
- Parameters:
- {Boolean} enable
- A boolean that specifies whether to enable XMLHttpRequest/XMLHTTP objects. Its value can be "true"(enable) or "false"(disable).
- Returns:
- None
- Returns:
- The FOI object array.
- Returns:
- A point type MVSdoGeometry object that specifies the map center coordinates in the map data coordinate system.
- Returns:
- The copyright text string
- Parameters:
- {string} id
- is a string that uniquely identifies the FOI object.
- Parameters:
- {String} format
- the map image format.
- {int} 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.
- {int} 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.
- Returns:
- {String} the XML map request string.
- Returns:
- The map tile layer configuration object.
- Parameters:
- {Object} screenXY
- the screen coordinates specified as an object with x and y attributes.
- Returns:
- MVSdoGeometry
- Parameters:
- {Function} 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.
- {String} format
- the map image format.
- {int} 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.
- {int} 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.
- Returns:
- none
- Parameters:
- {Function} 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.
- {String} 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.
- {String} 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.
- Returns:
- None.
- Returns:
- An array of MVMapTileLayer objects.
- Returns:
- {MVSdoGeometry} A rectangle MVSdoGeometry object that specifies the current map window bounding box.
- Returns:
- {int} The maximum zoom level.
- Returns:
- {MVSdoGeometry} A point type MVSdoGeometry object that specifies the current mouse location in the map data coordinate system.
- Parameters:
- {MVThemeBasedFOI} themeBasedFOI
- ThemeBasedFOI is an object that defines the theme-based FOI layer.
- Returns:
- the original theme-based FOI layer index(1-100)
- Returns:
- The current map srid.
- Parameters:
- {String} layerName
- Theme-based FOI object name.
- Returns:
- the MVThemeBasedFOI object
- Returns:
- The array of MVThemeBasedFOI objects
- Parameters:
- {object} themeBasedFOI
- themeBasedFOI is the MVThemeBasedFOI object that defines the theme-based FOI layer.
- Returns:
- The theme-based FOI layer index(1-100)
- Returns:
- {int} The current zoom level.
- Parameters:
- _event
- Parameters:
- _event
- Parameters:
- _event
- Parameters:
- _event
- Parameters:
- {int} 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.
- {int} y
- the panning offset in pixels on vertical direction. A positive value pans the map downward and a negative value pans the map upward.
- Returns:
- none.
- Parameters:
- {DIV} printMapDiv,
- a DIV element used to hold the printable map image.
- Returns:
- None
- Returns:
- None
- Parameters:
- {object} foiOrId
- an FOI object reference or id
- Returns:
- None
- Returns:
- None
- Parameters:
- {MVMapDecoration} mapdecoration
- the MVMapDecoration object to be removed
- Returns:
- None
- Parameters:
- {MVMapTileLayer} mapTileLayer
- the MVMapTileLayer object that specifies the map tile layer to be removed.
- Returns:
- None
- Parameters:
- {MVThemeBasedFOI} themebasedfoi
- the MVThemeBasedFOI object that specifies the theme-based FOI layer to be removed.
- Returns:
- None
- Parameters:
- {MVSdoGeometry} mpoint
- an MVSdoGeometry point object that specifies the map center
- {Boolean} noSmoothPanning
- whether not to pan the map in a animated sliding manner. True if no smooth panning, false otherwise.
- Returns:
- None
- Parameters:
- {MVSdoGeometry} center
- an MVSdoGeometry point object that specifies the map center.
- {int} zoomLevel
- an integer that specifies a valid zoom level.
- Parameters:
- {string} img_url
- a string that specifies the URL of the center mark image.
- {int} img_width
- specifies the width of the image marker.
- {int} img_height
- specifies the height of the image marker.
- Returns:
- None
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.
- Parameters:
- {String} format
- the default FOI image format.
- Returns:
- None
- hideCloseButton, a boolean that specifies whether to hide the close button.
- closeButtonImageURL, a string that specifies the URL of the close button image.
- bodyStyle, a CSS string that sepcifies the info window border width, border color, background color and etc. Example: "border:1px;border-color:#FF0000;background-color:#FFFFFF".
- titleBarStyle, a CSS string that specifies the title bar text color, background-color, text font, font size, font weight and etc. Example: "color:#ffffff;background-color:#483D8B;font-weight:bold;font-family:Aria;font-size:14".
- contentStyle, a CSS string that sepcifies the info window content style such as content padding, text font, color and etc. background color and etc. Example: "border:1px;border-color:#FF0000;background-color:#FFFFFF".
- coneStyle, a CSS string that specifies the color and opacity of the cone. Example:"background-color:#99CC33;opacity:30".
- offset, a integer that specifies the pixel offset of the info window relative to the anchor point.
Here is a usage example.
var parameters = {hideCloseButton:true, closeButtonImageURL:"/mapviewer/fsmc/images/infoicons/close_circle.gif", bodyStyle:"border:2px;border-color:#FF0000;background-color:#FFFFFF", titleBarStyle:"background-color:#8794A3", contentStyle:"padding:10px", coneStyle:"background-color:#00CCAA;opacity:30", offset:10} ; mapview.setDefaultInfoWindowStyle("InfoWindowStyle1", parameters);
- Parameters:
- {String} style
- the name of the info window style. The possible values are "MVInfoWindowStyle1", "MVInfoWindowStyle2" and "MVInfoWindowStyle3".
- {Object} styleParameters
- the object that specifies the custom style parameters.
- Parameters:
- {String} 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"
Error handler specified by this method is a global error handler. It is invoked only when there is no instance specific error handler defined.
An error handler is a javascript function which is called when an error occurs. The error message is passed to the error handler as the only parameter. By default, the error handler is "alert", which means a browser alert message window is displayed whenever an error occurs.
- Parameters:
- {Function} errorHandler
- the javascript function to handle errors.
- Returns:
- None
The error handler is a javascript function that is called whenever an error occurs. The error message is passed to error handler as the only parameter. By default, the error handler is "alert", which means a browser alert message window is displayed whenever an error occurs.
- Parameters:
- {Function} errorHandler
- the javascript function to handle errors.
- Returns:
- None
- Parameters:
- eventType
- listener
- Parameters:
- {MVSdoGeometry} center
- an MVSdoGeometry point object that specifies the home/original center.
- {int} zoomlevel
- an integer that specifies the home/original zoom level
- Parameters:
- {Boolean} visible
- a Boolean that specifies whether to show or hide the loading icon, true(show) or false(hide).
- Returns:
- None
- Parameters:
- {String} language
- language is a valid ISO Language Code. These codes are the lower-case, two-letter codes as defined by ISO-639.
- {String} country
- country is a valid ISO Country Code. These codes are the upper-case, two-letter codes as defined by ISO-3166
- Returns:
- None
- Parameters:
- {String} 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".
- {String} cursorType
- A string that specifies when the cursor style
should be used. Its value can be one of the following:
- "default" Cursor style to be used when the mouse is on the map and no mouse key has been pressed.
- "dragging" Cursor style to be used when the map is being dragged.
- Returns:
- None
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.
- Parameters:
- {String} proxyPath
- a String the specifies the relative path of the proxy server objects. Its value can be "true"(enable) or "false"(disable).
- Returns:
- None
- See:
- #enableXMLHTTP
- Parameters:
- {MVThemeBasedFOI} themeBasedFOI
- an MVThemeBasedFOI object that defines the theme-based FOI layer.
- {int} index
- Display index(1-100)
- Returns:
- None
- Parameters:
- {MVThemeBasedFOI} themeBasedFOI
- an MVThemeBasedFOI object that specifies the theme-based FOI layer.
- Returns:
- None
- Parameters:
- {String} url
- A string that specifies the base URL of the UI utility images.
- Returns:
- None
- Parameters:
- {boolean} enabledOrNot
- a boolean value which indicates whether or not to enable zoom animation
- Returns:
- None
- Parameters:
- {int} zoom
- an integer that specifies the map zoom level.
- Returns:
- None
- "one_time" In this mode, the user can use the marquee zoom tool for only once. After zooming the map by rectangle drawing for the first time, the marquee zoom tool becomes inactive and the user is no longer able to draw rectangle and zoom the map unless this method is invoked once again.
- "continuous" In this mode, the user can use the marquee zoom tool to zoom the map by rectangle drawing repeatedly. After each rectangle drawing and zooming, the user can immediately start drawing another rectangle and zooming the map by clicking and dragging the mouse. The marquee zoom tool stays active until MVMapView.stopMarqueeZoom is invoked.
- "prompt" In this mode, the user can use the marquee zoom tool to zoom the map by rectangle drawing repeatedly. After each rectangle drawing, the user needs to click on the rectangle to zoom the map. If the user clicks on the other part of the map, the rectangle disappears and the map will not be zoomed. The marquee zoom tool stays active until MVMapView.stopMarqueeZoom is invoked.
The style of the marquee zoom rectangle can be specified by parameter rectStyle, an object that may have the following attributes:
- borderColor A string that specifies the rectangle border color, e.g, "#FF0000".
- borderWidth An integer that specifies the width of the rectangle border in pixels.
- borderDashed A boolean that specifies whether to draw dashed(true) or solid(false).
- fillColor A string that specifies the rectangle fill color, e.g., "#555555".
- fillOpacity A float number ranging from 0(transparent) to 1(opaque) that specifies the rectangle fill opacity.
The following code shows how to create such an object.
var rectStyle = new Object() ; rectStyle.borderColor = "#00FF00" ; rectStyle.borderWidth = 1; rectStyle.borderDashed = true ; rectStyle.fillColor = "#FF0000" ; rectStyle.fillOpacity = 0.5 ;
- Parameters:
- {String} 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.
- {Object} 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.
- {int} 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.
- Returns:
- none
- Returns:
- none
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.
- Parameters:
- {MVSdoGeometry} geometry
- the MVSdoGeometry object to be transformed.
- {int} toSrid
- that specifies the SRID of the destination coordinate system.
- {string} 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.
- {function} callBack
- the call back function that is execuated after the coordinate system transformation is finished.
- {String} 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.
- Returns:
- The resulting MVSdoGeometry object when XMLHTTP/XMLHttpRequest objects are enabled. Null when XMLHTTP/XMLHttpRequest objects are disabled.
- See:
- #enableXMLHTTP
- Parameters:
- layerwidth
- Parameters:
- {MVSdoGeometry} center
- optional, an MVSdoGeometry that specifies the new center of the map after zooming.
- Returns:
- None
- Parameters:
- {MVSdoGeometry} center
- optional, an MVSdoGeometry that specifies the new center of the map after zooming.
- Returns:
- None
- Parameters:
- {MVSdoGeometry} sdoRectangle
- an MVSdoGeometry object that specifies the rectangle area to fill the map.
- Returns:
- none
- Requires:
- MVSdoGeometry