org.gwtopenmaps.openlayers.client.control
Class MousePositionOptions

java.lang.Object
  extended by org.gwtopenmaps.openlayers.client.util.JSObjectWrapper
      extended by org.gwtopenmaps.openlayers.client.OpenLayersObjectWrapper
          extended by org.gwtopenmaps.openlayers.client.OpenLayersEObjectWrapper
              extended by org.gwtopenmaps.openlayers.client.control.ControlOptions
                  extended by org.gwtopenmaps.openlayers.client.control.MousePositionOptions

public class MousePositionOptions
extends ControlOptions

See MousePosition.

Author:
Edwin Commandeur - Atlis EJS

Field Summary
 
Fields inherited from class org.gwtopenmaps.openlayers.client.OpenLayersEObjectWrapper
eventListeners
 
Constructor Summary
MousePositionOptions()
           
 
Method Summary
 void setFormatOutput(MousePositionOutput output)
           The output of the MousePosition control is determined by the formatOutput function of MouseOptions.
 void setGranularity(int granularity)
          Default granularity is 10.
 void setNumDigits(int numDigits)
          The number of digits to display in the fractional part of decimal LonLat coordinates.
 void setPrefix(String prefix)
          Text displayed before coordinates: prefixHere 0.00000, 0.0000
 void setSeparator(String separator)
          The separator between the Longitude and the Latitude.
 void setSuffix(String suffix)
          Text displayed after coordinates: 0.00000, 0.0000 suffixHere
 
Methods inherited from class org.gwtopenmaps.openlayers.client.OpenLayersEObjectWrapper
getListeners, narrowToOpenLayersEObjectWrapper, removeListener
 
Methods inherited from class org.gwtopenmaps.openlayers.client.OpenLayersObjectWrapper
getClassName, getEvents, narrowToOpenLayersObjectWrapper
 
Methods inherited from class org.gwtopenmaps.openlayers.client.util.JSObjectWrapper
getJSObject, setJSObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MousePositionOptions

public MousePositionOptions()
Method Detail

setFormatOutput

public void setFormatOutput(MousePositionOutput output)

The output of the MousePosition control is determined by the formatOutput function of MouseOptions. The format used is:

      prefix + longitude + separator + latitude + postfix
 
The prefix, number of significant digits of the longitude and latitude, the separator, and the postfix can all be changed, but sometimes it is desirable to change the format.

In OpenLayers you would override the formatOutput function to customize the format in which the geographic coordinates are displayed. In GWT-OpenLayers the same effect can be achieved by passing an instance of MousePositionOutput with a custom format function, see MousePositionOutput. For example:

     MousePositionOutput mpOut = new MousePositionOutput(){
         public String format(LonLat lonLat, Map map){
              String out = "";
              out += lonLat.lon();
              out += ", ";
              out += lonLat.lat();
              return out;
         }
     };
     setFormatOutput(mpOut);
 


setNumDigits

public void setNumDigits(int numDigits)
The number of digits to display in the fractional part of decimal LonLat coordinates. For example 3.14 has 2 digits in it's fractional part. Default number of fractional digits displayed is 5.


setSeparator

public void setSeparator(String separator)
The separator between the Longitude and the Latitude. Default separator is ", ".


setPrefix

public void setPrefix(String prefix)
Text displayed before coordinates: prefixHere 0.00000, 0.0000


setSuffix

public void setSuffix(String suffix)
Text displayed after coordinates: 0.00000, 0.0000 suffixHere


setGranularity

public void setGranularity(int granularity)
Default granularity is 10.



Copyright © 2011 sourceforge. All Rights Reserved.