in Components/PCF/AzureMaps/field/azureMapsFieldControl/index.ts [167:200]
private symbolActivate(e: any) {
//Make sure the event occurred on a point feature.
if (e.shapes && e.shapes.length > 0) {
var content, coordinate;
//Check to see if the first value in the shapes array is a Point Shape.
if (e.shapes[0] instanceof azureMapsControl.Shape && e.shapes[0].getType() === 'Point') {
var properties = e.shapes[0].getProperties();
content = this.popupTemplate.replace(/{name}/g, properties.name).replace(/{description}/g, properties.description);
coordinate = e.shapes[0].getCoordinates();
} else if (e.shapes[0].type === 'Feature' && e.shapes[0].geometry.type === 'Point') {
//Check to see if the feature is a cluster.
if (e.shapes[0].properties.cluster) {
content = '<div style="padding:10px;">Group of ' + e.shapes[0].properties.point_count + ' ' + 'Entities' + '</div>';
} else {
//Feature is likely from a VectorTileSource.
content = this.popupTemplate.replace(/{name}/g, properties.name).replace(/{description}/g, properties.description);
}
coordinate = e.shapes[0].geometry.coordinates;
}
if (content && coordinate) {
//Populate the popupTemplate with data from the clicked point feature.
this.popup.setOptions({
//Update the content of the popup.
content: content,
//Update the position of the popup with the symbols coordinate.
position: coordinate
});
//Open the popup.
this.popup.open(this.map);
}
}
}