OpenLayers.Layer.GML - OpenLayers

# OpenLayers. Layer.GML

Create a vector layer by parsing a GML file. The GML file is passed in as a parameter.

#### Inherits from

- OpenLayers.Layer.Vector

Summary

OpenLayers. Layer.GML | Create a vector layer by parsing a GML file.
Properties |
loaded | {Boolean} Flag for whether the GML data has been loaded yet.
format | {OpenLayers.Format} The format you want the data to be parsed with.
formatOptions | {Object} Hash of options which should be passed to the format when it is created.
Constructor |
OpenLayers. Layer.GML | Load and parse a single file on the web, according to the format provided via the ‘format’ option, defaulting to GML.
Functions |
setVisibility | Set the visibility flag for the layer and hide/show&redraw accordingly.
moveTo | If layer is visible and GML has not been loaded, load GML, then load GML and call OpenLayers.Layer.Vector.moveTo() to redraw at the new location.
loadGML |
setUrl | Change the URL and reload the GML
requestSuccess | Process GML after it has been loaded.
requestFailure | Process a failed loading of GML.

### Properties

### loaded

{Boolean} Flag for whether the GML data has been loaded yet.

### format

{OpenLayers.Format} The format you want the data to be parsed with.

### formatOptions

{Object} Hash of options which should be passed to the format when it is created. Must be passed in the constructor.

### Constructor

### OpenLayers. Layer.GML

Load and parse a single file on the web, according to the format provided via the ‘format’ option, defaulting to GML.

#### Parameters

name | {String}
url | {String} URL of a GML file.
options | {Object} Hashtable of extra options to tag onto the layer.

### Functions

### setVisibility

> setVisibility: function( | visibility,
> | noEvent | )

Set the visibility flag for the layer and hide/show&redraw accordingly. Fire event unless otherwise specified GML will be loaded if the layer is being made visible for the first time.

#### Parameters

visible | {Boolean} Whether or not to display the layer (if in range)
noEvent | {Boolean}

### moveTo

> moveTo:function( | bounds,
> | zoomChanged,
> | minor | )

If layer is visible and GML has not been loaded, load GML, then load GML and call OpenLayers.Layer.Vector.moveTo() to redraw at the new location.

#### Parameters

bounds | {Object}
zoomChanged | {Object}
minor | {Object}

### loadGML

> loadGML: function()

### setUrl

> setUrl:function( | url | )

Change the URL and reload the GML

#### Parameters

url | {String} URL of a GML file.

### requestSuccess

> requestSuccess:function( | request | )

Process GML after it has been loaded. Called by initialise() and loadUrl() after the GML has been loaded.

#### Parameters

request | {String}

### requestFailure

> requestFailure: function( | request | )

Process a failed loading of GML. Called by initialise() and loadUrl() if there was a problem loading GML.

#### Parameters

request | {String}

Base class for format reading/writing a variety of formats.

> setVisibility: function( | visibility,
> | noEvent | )

Set the visibility flag for the layer and hide/show&redraw accordingly.

> moveTo:function( | bounds,
> | zoomChanged,
> | minor | )

If layer is visible and GML has not been loaded, load GML, then load GML and call OpenLayers.Layer.Vector.moveTo() to redraw at the new location.

> loadGML: function()

> setUrl:function( | url | )

Change the URL and reload the GML

> requestSuccess:function( | request | )

Process GML after it has been loaded.

> requestFailure: function( | request | )

Process a failed loading of GML.
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
Close