# MapGIS3DTileFeature

#### new Cesium.MapGIS3DTileFeature()
MapGIS/M3D/MapGIS3DTileFeature.js 40

A feature of a `Cesium3DTileset`.

Provides access to a feature's properties stored in the tile's batch table, as well as the ability to show/hide a feature and change its highlight color via `MapGIS3DTileFeature#show` and `MapGIS3DTileFeature#color`, respectively.

Modifications to a `MapGIS3DTileFeature` object have the lifetime of the tile's content. If the tile's content is unloaded, e.g., due to it going out of view and needing to free space in the cache for visible tiles, listen to the `Cesium3DTileset#tileUnload` event to save any modifications. Also listen to the `Cesium3DTileset#tileVisible` event to reapply any modifications.

Do not construct this directly. Access it through `Cesium3DTileContent#getFeature` or picking using `Scene#pick` and `Scene#pickPosition`.

##### Example:

    // On mouse over, display all the properties for a feature in the console log.
    handler.setInputAction(function(movement) {
        var feature = scene.pick(movement.endPosition);
        if (feature instanceof Cesium.MapGIS3DTileFeature) {
            var propertyNames = feature.getPropertyNames();
            var length = propertyNames.length;
            for (var i = 0; i < length; ++i) {
                var propertyName = propertyNames[i];
                console.log(propertyName + ': ' + feature.getProperty(propertyName));
            }
        }
    }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);

### Members

#### color : Color
MapGIS/M3D/MapGIS3DTileFeature.js 77

Gets or sets the highlight color multiplied with the feature's color. When this is white, the feature's color is not changed. This is set for all features when a style's color is evaluated.

Default Value: ``Color.WHITE``

#### polylinePositions : Float64Array
MapGIS/M3D/MapGIS3DTileFeature.js 100

Gets a typed array containing the ECEF positions of the polyline. Returns undefined if `Cesium3DTileset#vectorKeepDecodedPositions` is false or the feature is not a polyline in a vector tile.

##### Experimental

This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

#### readonly primitive : Cesium3DTileset
MapGIS/M3D/MapGIS3DTileFeature.js 151

All objects returned by `Scene#pick` have a `primitive` property. This returns the tileset containing the feature.

#### show : Boolean
MapGIS/M3D/MapGIS3DTileFeature.js 57

Gets or sets if the feature will be shown. This is set for all features when a style's show is evaluated.

Default Value: `true`

#### readonly tileset : Cesium3DTileset
MapGIS/M3D/MapGIS3DTileFeature.js 135

Gets the tileset containing the feature.

### Methods

#### getProperty(name) → *
MapGIS/M3D/MapGIS3DTileFeature.js 211

Returns a copy of the value of the feature's property with the given name. This includes properties from this feature's class and inherited classes when using a batch table hierarchy.

Name | Type | Description
--- | --- | ---
`name` | String | The case-sensitive name of the property.

##### Returns:

The value of the property or `undefined` if the feature does not have this property.

##### Example:

    // Display all the properties for a feature in the console log.
    var propertyNames = feature.getPropertyNames();
    var length = propertyNames.length;
    for (var i = 0; i < length; ++i) {
        var propertyName = propertyNames[i];
        console.log(propertyName + ': ' + feature.getProperty(propertyName));
    }

##### See:

- https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy

#### getPropertyNames(results) → Array.<String>
MapGIS/M3D/MapGIS3DTileFeature.js 189

Returns an array of property names for the feature. This includes properties from this feature's class and inherited classes when using a batch table hierarchy.

Name | Type | Description
--- | --- | ---
`results` | Array.<String> | optional An array into which to store the results.

##### Returns:

The names of the feature's properties.

##### See:

- https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy

#### hasProperty(name) → Boolean
MapGIS/M3D/MapGIS3DTileFeature.js 176

Returns whether the feature contains this property. This includes properties from this feature's class and inherited classes when using a batch table hierarchy.

Name | Type | Description
--- | --- | ---
`name` | String | The case-sensitive name of the property.

##### Returns:

Whether the feature contains this property.

##### See:

- https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_batch_table_hierarchy

#### setProperty(name, value)
MapGIS/M3D/MapGIS3DTileFeature.js 313

Sets the value of the feature's property with the given name.

If a property with the given name doesn't exist, it is created.

Name | Type | Description
--- | --- | ---
`name` | String | The case-sensitive name of the property.
`value` | * | The value of the property that will be copied.

##### Throws:

- DeveloperError : Inherited batch table hierarchy property is read only.

##### Examples:

    var height = feature.getProperty('Height'); // e.g., the height of a building

    var name = 'clicked';
    if (feature.getProperty(name)) {
        console.log('already clicked');
    } else {
        feature.setProperty(name, true);
        console.log('first click');
    }