function MouseLocationComponent(map, options) {
  this._map = map;
  options = options || {};
  this._domNode = document.getElementById(options.domId);
  if (!this._domNode) {
    this._domNode = document.createElement('div');
    if (options.domId) {
      this._domNode.id = options.domId;
    }
    map.domNode.appendChild(this._domNode);
  }
  this._domNode.className = "mouseLocation";
  this._coordinatesNode = document.createElement("span");
  this._coordinatesNode.className = "coordinates";
  this._domNode.appendChild(this._coordinatesNode);
  this._heightNode = document.createElement("span");
  this._heightNode.className = "height";
  this._domNode.appendChild(this._heightNode);
  this._outRef = options.outReference || getReference("EPSG:4326");
  this._formatter = options.formatter || new LonLatPointFormat({
    pattern: "lat(+DMS), lon(+DMS)"
  });
  try {
    this._transformation = createTransformation(this._map.reference, this._outRef);
  } catch (e) {
    //Fallback for failed transformation
    this._transformation = createTransformation(this._map.reference, this._map.reference);
    this._formatter = {
      //Fallback formatter that outputs points.
      format: function(point) {
        return "( x:" + Number(point.x).toFixed(2) + ", y:" + Number(point.y).toFixed(2) + ")";
      }
    };
    this._outRef = this._map._reference;
  }
  this._tempViewPoint = createPoint(null, [0, 0]);
  this._tempMapPoint = createPoint(this._map.reference, [0, 0]);
  this._tempModelPoint = createPoint(this._outRef, [0, 0]);
  this._heightProvider = options.heightProvider;
  this.displayHeight = (typeof options.displayHeight !== "undefined") ? options.displayHeight : (this._map.reference.identifier === "EPSG:4978") ? true : !!this._heightProvider;
  this._heightProviderRequestResolved = true;
  this._mapNodePosition = this._map.domNode.getBoundingClientRect();
  this._mouseMovedListener = this._mouseMoved.bind(this);
  this._map.domNode.addEventListener("mousemove", this._mouseMovedListener, false);
  this._map.domNode.addEventListener("mousedrag", this._mouseMovedListener, false);
}
/**
 * Creates a mouse location readout for the given map.
 * It consists of a single div, with class .mouseLocationComponent.
 * The default styling can be found in MouseLocationComponent.css.
 * @param map The map to create the mouse location readout for.
 * @param options An options literal. The following options are supported:
 *        <ul>
 *          <li><b>options.domId</b> The dom ID of the DIV that is the mouse location readout.
 *             When omitted, this div will be created for you inside the map's DOM node.
 *             When specified and an element with that ID exists, that element will be used.
 *             When specified and no element with that ID exists, that ID will be assigned to the
 *              DOM node that was created for you inside the map's DOM node.</li>
 *           <li><b>options.outReference</b> Points under the mouse cursor will be transformed
 *             to this reference. Points passed to the formatter will be in this reference.
 *             Defaults to EPSG:4326.</li>
 *           <li><b>options.formatter</b> The {@link luciad.view.format format} used to covert
 *             points to a string. Defaults to {@link luciad.view.format.LonLatPointFormat}.</li>
 *           <li><b>options.heightProvider</b> Height provider to retrieve the height of the terrain.
 *             This service is used asynchronously and therefore the height value might be displayed with a delay.
 *             The height value is displayed in 2D and 3D.  Its accuracy depends on the service.
 *             If not set, the height data of the model is used.  This is faster but only available in 3D and might be less accurate.
 *             An example height provider can be found in samples/terrainservices/HeightProvider.</li>
 *        </ul>
 * @constructor
 */
Creates a mouse location readout for the given map.
It consists of a single div, with class .mouseLocationComponent.
The default styling can be found in MouseLocationComponent.css.
@param map The map to create the mouse location readout for.
@param options An options literal. The following options are supported:

options.domId The dom ID of the DIV that is the mouse location readout.
When omitted, this div will be created for you inside the map's DOM node.
When specified and an element with that ID exists, that element will be used.
When specified and no element with that ID exists, that ID will be assigned to the
DOM node that was created for you inside the map's DOM node.
options.outReference Points under the mouse cursor will be transformed
to this reference. Points passed to the formatter will be in this reference.
Defaults to EPSG:4326.
options.formatter The  luciad.view.format format used to covert
points to a string. Defaults to  luciad.view.format.LonLatPointFormat.
options.heightProvider Height provider to retrieve the height of the terrain.
This service is used asynchronously and therefore the height value might be displayed with a delay.
The height value is displayed in 2D and 3D.  Its accuracy depends on the service.
If not set, the height data of the model is used.  This is faster but only available in 3D and might be less accurate.
An example height provider can be found in samples/terrainservices/HeightProvider.

@constructor
Creates a mouse location readout for the given map . It consists of a single div with class . mouseLocationComponent . The default styling can be found in MouseLocationComponent . css . @param map The map to create the mouse location readout for . @param options An options literal . The following options are supported : options . domId The dom ID of the DIV that is the mouse location readout . When omitted this div will be created for you inside the map ' s DOM node . When specified and an element with that ID exists that element will be used . When specified and no element with that ID exists that ID will be assigned to the DOM node that was created for you inside the map ' s DOM node . options . outReference Points under the mouse cursor will be transformed to this reference . Points passed to the formatter will be in this reference . Defaults to EPSG : 4326 . options . formatter The luciad . view . format format used to covert points to a string . Defaults to luciad . view . format . LonLatPointFormat . options . heightProvider Height provider to retrieve the height of the terrain . This service is used asynchronously and therefore the height value might be displayed with a delay . The height value is displayed in 2D and 3D . Its accuracy depends on the service . If not set the height data of the model is used . This is faster but only available in 3D and might be less accurate . An example height provider can be found in samples / terrainservices / HeightProvider . @constructor
function MouseLocationComponent(map, options) {
  this._map = map;
  options = options || {};
  this._domNode = document.getElementById(options.domId);
  if (!this._domNode) {
    this._domNode = document.createElement('div');
    if (options.domId) {
      this._domNode.id = options.domId;
    }
    map.domNode.appendChild(this._domNode);
  }
  this._domNode.className = "mouseLocation";
  this._coordinatesNode = document.createElement("span");
  this._coordinatesNode.className = "coordinates";
  this._domNode.appendChild(this._coordinatesNode);
  this._heightNode = document.createElement("span");
  this._heightNode.className = "height";
  this._domNode.appendChild(this._heightNode);
  this._outRef = options.outReference || getReference("EPSG:4326");
  this._formatter = options.formatter || new LonLatPointFormat({
    pattern: "lat(+DMS), lon(+DMS)"
  });
  try {
    this._transformation = createTransformation(this._map.reference, this._outRef);
  } catch (e) {
    this._transformation = createTransformation(this._map.reference, this._map.reference);
    this._formatter = {
      format: function(point) {
        return "( x:" + Number(point.x).toFixed(2) + ", y:" + Number(point.y).toFixed(2) + ")";
      }
    };
    this._outRef = this._map._reference;
  }
  this._tempViewPoint = createPoint(null, [0, 0]);
  this._tempMapPoint = createPoint(this._map.reference, [0, 0]);
  this._tempModelPoint = createPoint(this._outRef, [0, 0]);
  this._heightProvider = options.heightProvider;
  this.displayHeight = (typeof options.displayHeight !== "undefined") ? options.displayHeight : (this._map.reference.identifier === "EPSG:4978") ? true : !!this._heightProvider;
  this._heightProviderRequestResolved = true;
  this._mapNodePosition = this._map.domNode.getBoundingClientRect();
  this._mouseMovedListener = this._mouseMoved.bind(this);
  this._map.domNode.addEventListener("mousemove", this._mouseMovedListener, false);
  this._map.domNode.addEventListener("mousedrag", this._mouseMovedListener, false);
}
function MouseLocationComponent ( map , options ) { this . _map = map ; options = options || { } ; this . _domNode = document . getElementById ( options . domId ) ; if ( ! this . _domNode ) { this . _domNode = document . createElement ( 'div' ) ; if ( options . domId ) { this . _domNode . id = options . domId ; } map . domNode . appendChild ( this . _domNode ) ; } this . _domNode . className = "mouseLocation" ; this . _coordinatesNode = document . createElement ( "span" ) ; this . _coordinatesNode . className = "coordinates" ; this . _domNode . appendChild ( this . _coordinatesNode ) ; this . _heightNode = document . createElement ( "span" ) ; this . _heightNode . className = "height" ; this . _domNode . appendChild ( this . _heightNode ) ; this . _outRef = options . outReference || getReference ( "EPSG:4326" ) ; this . _formatter = options . formatter || new LonLatPointFormat ( { pattern : "lat(+DMS), lon(+DMS)" } ) ; try { this . _transformation = createTransformation ( this . _map . reference , this . _outRef ) ; } catch ( e ) { this . _transformation = createTransformation ( this . _map . reference , this . _map . reference ) ; this . _formatter = { format : function ( point ) { return "( x:" + Number ( point . x ) . toFixed ( 2 ) + ", y:" + Number ( point . y ) . toFixed ( 2 ) + ")" ; } } ; this . _outRef = this . _map . _reference ; } this . _tempViewPoint = createPoint ( null , [ 0 , 0 ] ) ; this . _tempMapPoint = createPoint ( this . _map . reference , [ 0 , 0 ] ) ; this . _tempModelPoint = createPoint ( this . _outRef , [ 0 , 0 ] ) ; this . _heightProvider = options . heightProvider ; this . displayHeight = ( typeof options . displayHeight !== "undefined" ) ? options . displayHeight : ( this . _map . reference . identifier === "EPSG:4978" ) ? true : ! ! this . _heightProvider ; this . _heightProviderRequestResolved = true ; this . _mapNodePosition = this . _map . domNode . getBoundingClientRect ( ) ; this . _mouseMovedListener = this . _mouseMoved . bind ( this ) ; this . _map . domNode . addEventListener ( "mousemove" , this . _mouseMovedListener , false ) ; this . _map . domNode . addEventListener ( "mousedrag" , this . _mouseMovedListener , false ) ; }
Creates a mouse location readout for the given map.
Creates a mouse location readout for the given map .
//Fallback for failed transformation //Fallback formatter that outputs points.