This discussion is archived
2 Replies Latest reply: Jul 8, 2013 7:53 AM by jsharma RSS

zoomLevels Parameter Syntax/Example - OM.universe.Universe Class

wblum Newbie
Currently Being Moderated

I am using the latest Mapviewer version 11.1.1.7.1 and am coding with the new Oracle Maps Html5 API.

 

I have a question concerning the OM.universe.Universe Class.  The documentation for the class lists the parameters for the Universe class, but I cannot find any information or examples on how to use the "zoomLevels" parameter for the class.

 

Does anyone have an example showing the syntax of the "zoomLevels {Array}" parameter for this class?

 

Thanks in advance for your help.

 

FYI ... here is the contents of the OM.universe.Universe Class from the documentation:

 

OM.universe.Universe(config)

 

This class defines zoom levels, overall map bounds and spatial reference information for the current mapping session. This contextual information is collectively called a map Universe. By default, a map universe is automatically derived from the tile layer definition if there is one. If the zoomLevels array is not specified, it will be automatically calculated based on the following assumptions:

 

    numberOfZoomLevel sis specified and used to generated the zoom levels

    At zoom level 0, the full map extent is entirely contained in a single tile

 

Parameters:

{Object} config

    The config specifies the Universe parameters. It can have the following attributes:

 

        srid {int} The map srid. Use an Oracle Spatial SRID value, e.g. 4326, 3785, 8307, 8265 etc.

        bounds {OM.geometry.Rectangle} The map bounds.

        zoomLevels {Array} An array of OM.universe.ZoomLevel. The map zoom level scheme.

        numberOfZoomLevels {int} The number of map zoom levels.

  • 1. Re: zoomLevels Parameter Syntax/Example - OM.universe.Universe Class
    xin1008396 Newbie
    Currently Being Moderated

    zoomLevels {Array} An array of OM.universe.ZoomLevel. The map zoom level scheme.

    It should be the following:

    {...,

        "zoomLevels":

        [

        {"zoomLevel":0,"name":"","tileWidth":4.00750166855785E7,"tileHeight":4.00750166855785E7,"tileImageWidth":256,"tileImageHeight":256},

        {"zoomLevel":1,"name":"","tileWidth":2.0037508E7,"tileHeight":2.0037508E7,"tileImageWidth":256,"tileImageHeight":256},

        {"zoomLevel":2,"name":"","tileWidth":1.0018754E7,"tileHeight":1.0018754E7,"tileImageWidth":256,"tileImageHeight":256},

        {"zoomLevel":3,"name":"","tileWidth":5009377.0,"tileHeight":5009377.0,"tileImageWidth":256,"tileImageHeight":256}

        ]

    }

  • 2. Re: zoomLevels Parameter Syntax/Example - OM.universe.Universe Class
    jsharma Pro
    Currently Being Moderated

    Use zoomLevels when you want to explicitly specify the levels and resolution (scale) for each level instead.

    The zoomLevel is defined as:

     

    OM.universe.ZoomLevel(resolution, options) 

    The zoom level scheme of the map is usually the same as that of the tile layer, in which case the application does not need to explicitly set the zoom level scheme. The application needs to invoke this method only when the map has multiple tile layers and the zoom level schemes of the tile layers are different. 

    Parameters:
    {double}  resolution 
    Map resolution (map units per pixel).
    {Object}  options 
    The config specifies the Universe parameters. It can have the following attributes.
    • stretchRatio {float} Optional. stretchRatio is used only when map's vertical resolution and horizontal resolution are different. The map's horizontal resolution is always specified by the resolution attribute. The vertical resolution is calculated by multiplying the map's horizontal resolution by stretchRatio. The default value of this attribute is 1.
    • infotip {String} The info string displayed when the mouse hovers on the navigation panel zoom slider.
    Returns:
    {OM.universe.ZoomLevel} The newly created ZoomLevel object.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points