Snippets

Piotr Szrajber Geospatial Portal SDK - Add Text Geometry with rotation

Created by Piotr Szrajber
var pssName = "Feature";

var geojson = {
    type: "FeatureCollection",
    features: [{
        "type": "Feature",
        "geometry": {
            "type": "Point",
            "coordinates": [78.72828668216215, 30.996168807331422],
            "crsId": "EPSG:3857",
            "rotation": 45,
            "text": "TEST123"
        }
    }]
};


var featureClassDefinitions = [{
    featureClassId: "AngleText",
    fields: [{
        "aliasName": null,
        "fullTypeName": null,
        "geometryType": 6,
        "name": "geometry",
        "type": "Intergraph.WebSolutions.Core.WebClient.Platform.Serialization.Stubs.Geometry"
    }],
    geometryType: 6,
}];

var mapserviceId;
$GP.edit.PSS.add({
    name: pssName,
    featureClassDefinitions: featureClassDefinitions
}, function pssAdded(ret) {
    mapserviceId = ret.mapServiceId;
    $GP.legend.add({
        mapServiceId: mapserviceId,
        names: ret.featureClassIds
    }, function() {
        $GP.edit.features.add({
            mapServiceId: mapserviceId,
            featureClassId: "AngleText",
            geojson: geojson
        }, function() {

        });
    });
});

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.