/** * <p>Interface I_PublicInterface models the public interface object of OFM. </p> * @version 4.2 Sept 2006 */ interface com.orbitgis.ofm.I_PublicInterface { ////////////////////////////////////////////////////////////////////////////////////// // Compass Rose ////////////////////////////////////////////////////////////////////////////////////// /** Pans view 1/4 left */ function panLeft():Void; /** Pans view 1/4 right */ function panRight():Void; /** Pans view 1/4 up */ function panUp():Void; /** Pans view 1/4 up and left */ function panUpLeft():Void; /** Pans view 1/4 up and right */ function panUpRight():Void; /** Pans view 1/4 down */ function panDown():Void; /** Pans view 1/4 down and left */ function panDownLeft():Void; /** Pans view 1/4 down and right */ function panDownRight():Void; ////////////////////////////////////////////////////////////////////////////////////// // Zoom navigation ////////////////////////////////////////////////////////////////////////////////////// /** * Go to previous view state, if available. */ function previousView():Void; /** * Go to next view state, if available. */ function nextView():Void; /** * Previous state available? * @return Returns presence of previous state. */ function hasPreviousView():Boolean; /** * Next state available? * @return Returns presence of next state. */ function hasNextView():Boolean; ////////////////////////////////////////////////////////////////////////////////////// // Map Modes ////////////////////////////////////////////////////////////////////////////////////// /** * Add a function to be notified when the active mode changes. * @param listener The function to notify. */ function addActiveModeChangeListener(listener:Function):Void; /** * Stops a function from being notified when the active mode changes. * @param listener The function to notify. */ function removeActiveModeChangeListener(listener:Function):Void; /** * Sets active view mode. * Each mode is identified by its name. * Its important to know that a mode can only be activated if there's a corresponding toolbar button (doesn't work if a button is disabled in uiconfig)! * @param mode Identifies the mode to activate. For candidates see documentation at the top. */ function setActiveMode(mode:String):String; /** * Get active view mode. * @return Returns mode identifier. */ function getActiveMode():String; ////////////////////////////////////////////////////////////////////////////////////// // Layers ////////////////////////////////////////////////////////////////////////////////////// /** * Toggles visibility of a layer. * @param item Index of the layer (ranges from 0 to getLayerCount()). * @param withReload Reload view after toggle? */ function toggleLayer(item:Number, withReload:Boolean):Void; /** * Returns array with layer names. * Returns array with layer names, in the order in which they are defined. Layer 0 is the topmost layer. * @return Array instance with names of all layers. */ function getLayerNames():Array; /** * Returns array with layer visibilities, in the order in which they are defined. Layer 0 is the topmost layer. * @return Array instance with visibilities (boolean) of all layers. */ function getLayerVisibilities():Array; /** * Get the number of available layers. * @return Returns number of layers. */ function getLayerCount():Number; ////////////////////////////////////////////////////////////////////////////////////// // Zoom/Scale ///////////////////////////////////////////////////////////////////////////// /** * Zoom to extent of all available data. * Limited by scale limits. */ function zoomToExtent():Void; /** * Zoom to extent of focus rectangle (stored in IOS session). * Limited by scale limits. */ function zoomToFocus():Void; /** * Zoom to extent of selected objects. * Limited by scale limits. */ function zoomToSelection():Void; /** * Zoom to extent of active selected object. * Limited by scale limits. */ function zoomToActiveSelection():Void; /** * Zoom to custom extent. * Limited by scale limits. * @param box A plain object containing minX, minY, maxX, maxY properties defining the bounds. * @param addMargin Add the defined zoom margin to the bounds? */ function zoomToBoundingBox(box:Object, addMargin:Boolean):Void; /** * Set scalerange position. * @param position Scale position (ranges from 0.0 (max zoomin) to 1.0 (max zoomout)). */ function setScaleRangePosition(position:Number):Void; /** * Get scalerange position. * @return Returns scale position (ranges from 0.0 (max zoomin) to 1.0 (max zoomout)). */ function getScaleRangePosition():Number; /** * Processes operation responses. * Supported operation responses: GetFocus operation (returns a document containing new focus bounds). */ function processOperationResponse(operationName:String, response:XML); /** * Sets zoom margin. * This setting affects all the zoomTo.. functions (except zoomToFocus()). * @param margin Width of the zoom margin, expressed in system units. */ function setZoomToMargin(margin:Number):Void; /** * Gets zoom margin. * @return Returns the width of the zoom margin, expressed in system units. */ function getZoomToMargin():Number; ////////////////////////////////////////////////////////////////////////////////////// // View related ////////////////////////////////////////////////////////////////////////////////////// /** * Add a function to be notified when a new view is loaded. * @param listener The function to notify. */ function addNewViewListener(listener:Function):Void; /** * Stops a function from being notified when a new view is loaded. * @param listener The function to notify. */ function removeNewViewListener(listener:Function):Void; /** * Force reload of the view (fetched from server). */ function loadNewView():Void; /** * Get width of current view in pixels. * @see #toSystemDistance() * @return Returns width in pixels. */ function getViewWidth():Number; /** * Get height of current view in pixels. * @see #toSystemDistance() * @return Returns height in pixels. */ function getViewHeight():Number; /** * Get bounds of current view. * @return Returns object with minX, minY, maxX and maxY attributes (Respectively 'topleft' and 'bottomright') in system coordinates. */ function getViewBoundingBox():Object; ////////////////////////////////////////////////////////////////////////////////////// // Selected objects (active object->attributerow->attribute->(name|value|type)) ////////////////////////////////////////////////////////////////////////////////////// /** * Set the active hyperlink layer. * @param layer Name of the layer to use. */ function setHyperlinkLayer(layer:String):Void; /** * Set the name of the attribute to be used as hyperlink. * @param attribute An attribute in the current hyperlink layer. */ function setHyperlinkAttribute(attribute:String):Void; /** * Set the active maptip layer. * @param layer Name of the layer to use. */ function setMapTipLayer(layer:String):Void; /** * Set the active selection layer. * @param layer Name of the layer to use. */ function setSelectionLayer(layer:String):Void; /** * Add a function to be notified when the selection changed. * @param listener The function to notify. */ function addNewSelectionListener(listener:Function):Void; /** * Stops a function from being notified when the selection changed. * @param listener The function to notify. */ function removeNewSelectionListener(listener:Function):Void; /** * Add a function to be notified when the active selection changes (and new rows are loaded). * (The active selection changes by calling activateSelectedObject() or by the user using the subquery function map mode). * @param listener The function to notify. */ function addNewRowsListener(listener:Function):Void; /** * Stops a function from being notified when the active selection changes. * @param listener The function to notify. */ function removeNewRowsListener(listener:Function):Void; /** * Add a function to be notified when a new attribute row has been selected. * (The selected row changes by calling selectAttributeRow()). * @param listener The function to notify. */ function addNewRowListener(listener:Function):Void; /** * Stops a function from being notified when a new attribute row has been selected. * @param listener The function to notify. */ function removeNewRowListener(listener:Function):Void; /** * Get number of selected objects. * @return Returns the number. */ function getSelectedObjectCount():Number; /** * Activates a selected object. This means, loading its attribute rows. * This happens asynchronously, so you must listen to events on new rows (using the addNewRowsListener(), which will be fired when the row is loaded. * @param position The index of the object to activate. */ function activateSelectedObject(position:Number):Void; /** * Get the active selected object * @return Returns the index of the active selected object relative to the list of selected objects. */ function getActiveSelectedObject():Number; /** * Selects an attribute row of the currently active selected object. * @param id The number of the row to select. */ function selectAttributeRow(id:Number):Void; /** * Returns the number of attributerows associated with the active selected object. * @return Returns the number of rows. */ function getAttributeRowCount():Number; /** * Returns the number of attributes in the selected attribute row. * @return Returns the number of attributes. */ function getAttributeCount():Number; /** * Get the name of an attribute. * @param id Attribute index. * @return Returns the name string. */ function getAttributeName(id:Number):String; /** * Get the value of an attribute. * @param id Attribute index. * @return Returns the value string. */ function getAttributeValue(id:Number):String; /** * Get the type of an attribute. * @param id Attribute index. * @return Returns the type string. */ function getAttributeType(id:Number):String; /** * Gets the bounds of the last selection drag (when in query mode). * @return Returns object with minX, minY, maxX and maxY attributes (Respectively 'topleft' and 'bottomright') in system coordinates. */ function getSelectionBoundingBox():Object; ////////////////////////////////////////////////////////////////////////////////////// // Hyperlink selection ////////////////////////////////////////////////////////////////////////////////////// /** * Add a function to be notified when the user clicks a hyperlink on the map. * @param listener The function to notify. */ function addNewHyperlinkListener(listener:Function):Void; /** * Stops a function from being notified when the user clicks a hyperlink on the map. * @param listener The function to notify. */ function removeNewHyperlinkListener(listener:Function):Void; /** * Get the hyperlink value. * @return Returns the selected hyperlink. */ function getHyperlink():String; ////////////////////////////////////////////////////////////////////////////////////// // State info ////////////////////////////////////////////////////////////////////////////////////// /** * Add a function to be notified when the main state of the component changes. * (See top for more information). * @param listener The function to notify. */ function addClientStateChangedListener(listener:Function):Void; /** * Stops a function from being notified when the main state of the component changes. * @param listener The function to notify. */ function removeClientStateChangedListener(listener:Function):Void; /** * Get the current client state. * @return Returns the current client state. * (See top for more info) */ function getClientState():String; /** * Add a function to be notified when the busy state of the map component changes. * @param listener The function to notify. */ function addBusyChangedListener(listener:Function):Void; /** * Stops a function from being notified when the busy state of the map component changes. * @param listener The function to notify. */ function removeBusyChangedListener(listener:Function):Void; /** * Gets the busy state of the map component. * @return Returns true if busy, false if not. */ function isBusy():Boolean; ////////////////////////////////////////////////////////////////////////////////////// // Measure functions ////////////////////////////////////////////////////////////////////////////////////// /** * Set the callback function, to be called when a measurement is added. * @param listener The function to notify. */ function addMeasurementsChangedListener(listener:Function):Void; /** * Stops a function from being notified when a measurement is added. * @param listener The function to notify. */ function removeMeasurementsChangedListener(listener:Function):Void; /** * Set the callback function, to be called when the measure situation changes (Read: On mousemove). * @param listener The function to notify. */ function addMeasureChangedListener(listener:Function):Void; /** * Stops a function from being notified when the measure situation changes. * @param listener The function to notify. */ function removeMeasureChangedListener(listener:Function):Void; /** * Clear all measurements. */ function clearMeasurements():Void; /** * Get total length of the polyline defined by all measurements. * @return Returns the length in system units. */ function getMeasurementsLength():Number; /** * Get the area described by by all measurements. * @return Returns the area in system units. */ function getMeasurementsArea():Number; /** * Get total length of the polyline defined by all measurements and the current mouse position. * @return Returns the length in system units. */ function getMeasureLength():Number; /** * Get the area described by by all measurements and the current mouse position. * @return Returns the area in system units. */ function getMeasureArea():Number; /** * Converts distance in system units to a human readable string. * @param The number of system units. * @return Returns a human readable string. */ function describeDistance(distance:Number):String; /** * Converts area in system units to a human readable string. * @param The number of system units. * @return Returns a human readable string. */ function describeArea(area:Number):String; /** * Get the number of measurements. * @return Returns measurements count. */ function getMeasurementsCount():Number; /** * Returns a measurement. * @param idx Index of the measurement. * @return Returns an object with x and y properties for coordinates. */ function getMeasurement(idx:Number):Object; ////////////////////////////////////////////////////////////////////////////////////// // Miscellaneous ////////////////////////////////////////////////////////////////////////////////////// /** * Prints the current view. * Pops up a print dialog, printing the current map view. */ function printMap():Void; /** * Stops the mapping component (most notably stops all timeout timers, * so you get no unwanted side-effects when reloading the movieclip). * @since 4.3 */ function stopComponent():Void; /** * Instructs OFM to run a new start operation. * Invoking a startup operation implies the operation returns a set of bounds and also implies a view reload is necessary. * @param operationURL URL where the operation instructions are to be fetched. */ function runNewStartOperation(operationURL:String):Void; /** * Instructs OFM to run an operation. * @param requestDoc Document containing operation instructions. * @param responseDoc Document containing the IOS response. */ function runIOSOperation(requestDoc:XML,responseDoc:XML):Void /** * Returns URL to an image of the current view. * @param format Image format of the image (jpg, gif, swf..) */ function getViewURL(format:String):String; /** * Sets a session parameter's value. * Client state must be 'started' before executing this function. * @param name Name of the parameter. * @param value Value of the parameter. */ function setSessionParameter(name:String, value:String):Void; /** * Gets a session parameter's value. * Client state must be 'started' before executing this function. * @return Returns value of the parameter. */ function getSessionParameter(name:String):String; /** * Set an internal OFM parameter. * <table colspan="0" cellpadding="0" border="0"> * <tr> * <th> Parameter name </th> * <th> Value type </th> * <th> Comment </th> * </tr> * <tr> * <td> CustomizeCursor </td> * <td> Boolean </td> * <td> Use this setting to set whether <acronym title="Orbit FlashMap">OFM</acronym> should render its own mouse-cursor when hovering the map. This can be necessary if you want to provide application-wide cursors. You can use the mode listener to be notified of any changes in <a href="#map_modes" title="flashmap:publicinterface:overview" class="wikilink1">OFM's map mode</a>. </td> * </tr> * <tr> * <td> MeasureLineWidth </td> * <td> Number </td> * <td> Use this setting to override the default measure line width. </td> * </tr> * <tr> * <td> MeasureLineColor </td> * <td> Color </td> * <td> Use this setting to override the default measure color. Example value : 0xFFFF00 </td> * </tr> * <tr> * <td> ShowActiveCentroid </td> * <td> Boolean </td> * <td> Sets wether a centroid is drawn, indicating the active selected object. </td> * </tr> * </table> * @param parameterName Name of the parameter. * @param parameterValue Value of the parameter. */ function setOFMParameter(parameterName:String, parameterValue):Void; /** * Convert pixel coordinate to system coordinate. * @param X coordinate. * @param Y coordinate. * @returns An object with x and y properties, defining the corresponding pixel coordinate. */ function toSystem(x:Number, y:Number) : Object; /** * Convert system coordinate to pixel coordinate. * @param X coordinate. * @param Y coordinate. * @returns An object with x and y properties, defining the corresponding system coordinate. */ function toPixel(x:Number, y:Number) : Object; /** * Convert pixel size to system size. * @param distance Distance in system units. * @return The corresponding distance in pixels. */ function toSystemSize(distance:Number) : Number; /** * Convert system size to pixel size. * @param distance Distance in pixels. * @return The corresponding distance in system units. */ function toPixelSize(distance:Number) : Number; }