Class: viewerDragDropMixin

viewerDragDropMixin

new viewerDragDropMixin(viewer)

This function is not directly called, usually passed as a parameter to Viewer # extend, as shown in the following example.

Name Type Default Description
viewer Viewer

Viewer instance.

options.dropTarget Element | String viewer.container optional

The DOM element that will serve as the dropdown target.

options.clearOnDrop Boolean true optional

When set to true, deleting a file will first clear all existing data sources; When false, the new data source will be loaded after the existing data source.

options.flyToOnDrop Boolean true optional

When true, after the data source is loaded, discarding the file will locate the data source.

options.clampToGround Boolean true optional

When true, the data source is restricted to the ground.

options.proxy DefaultProxy optional

Proxy for KML network links.

Throws:
  • There is no element with IDin the document.

    Type
    DeveloperError
  • DropTarget has already been defined by another mixin.

    Type
    DeveloperError
  • DropEnabled has already been defined by another mixin.

    Type
    DeveloperError
  • DropError has already been defined by another mixin.

    Type
    DeveloperError
  • ClearOnDrop has already been defined by another mixin.

    Type
    DeveloperError
Example
// Add basic drag and drop support and pop up an alert window on error.
var viewer = new SuperMap3D.Viewer('Container');
viewer.extend(SuperMap3D.viewerDragDropMixin);
viewer.dropError.addEventListener(function(viewerArg, source, error) {
    window.alert('Error processing ' + source + ':' + error);
});

Members

clampToGroundBoolean

Get or set a value indicating whether the data source is restricted to the ground.

clearOnDropBoolean

Gets or sets a value indicating whether the camera should locate the data source after loading it.

dropEnabledElement

Get or set a value indicating whether drag and drop support is enabled.

dropErrorEvent

Retrieve the event triggered when an error is encountered during the dropdown process.

dropTargetElement

Get or set the element as the dropdown target.

flyToOnDropBoolean

Gets or sets a value indicating whether the camera should locate the data source after loading it.

proxyDefaultProxy

Get or set a proxy for KML.