lib/ReactViews/Map/Panels/SharePanel/BuildShareLink.js
function addFeaturePicking(terria, initSources) {
  if (
    defined(terria.pickedFeatures) &&
    terria.pickedFeatures.features.length > 0
  ) {
    const positionInRadians = Ellipsoid.WGS84.cartesianToCartographic(
      terria.pickedFeatures.pickPosition
    );

    const pickedFeatures = {
      providerCoords: terria.pickedFeatures.providerCoords,
      pickCoords: {
        lat: CesiumMath.toDegrees(positionInRadians.latitude),
        lng: CesiumMath.toDegrees(positionInRadians.longitude),
        height: positionInRadians.height
      }
    };

    if (defined(terria.selectedFeature)) {
      // Sometimes features have stable ids and sometimes they're randomly generated every time, so include both
      // id and name as a fallback.
      pickedFeatures.current = {
        name: terria.selectedFeature.name,
        hash: hashEntity(terria.selectedFeature, terria.clock)
      };
    }

    // Remember the ids of vector features only, the raster ones we can reconstruct from providerCoords.
    pickedFeatures.entities = terria.pickedFeatures.features
      .filter(feature => !defined(feature.imageryLayer))
      .map(entity => {
        return {
          name: entity.name,
          hash: hashEntity(entity, terria.clock)
        };
      });

    initSources.push({
      pickedFeatures: pickedFeatures
    });
  }
}
function addFeaturePicking(terria, initSources) {
  if (
    defined(terria.pickedFeatures) &&
    terria.pickedFeatures.features.length > 0
  ) {
    const positionInRadians = Ellipsoid.WGS84.cartesianToCartographic(
      terria.pickedFeatures.pickPosition
    );

    const pickedFeatures = {
      providerCoords: terria.pickedFeatures.providerCoords,
      pickCoords: {
        lat: CesiumMath.toDegrees(positionInRadians.latitude),
        lng: CesiumMath.toDegrees(positionInRadians.longitude),
        height: positionInRadians.height
      }
    };

    if (defined(terria.selectedFeature)) {
      // Sometimes features have stable ids and sometimes they're randomly generated every time, so include both
      // id and name as a fallback.
      pickedFeatures.current = {
        name: terria.selectedFeature.name,
        hash: hashEntity(terria.selectedFeature, terria.clock)
      };
    }

    // Remember the ids of vector features only, the raster ones we can reconstruct from providerCoords.
    pickedFeatures.entities = terria.pickedFeatures.features
      .filter(feature => !defined(feature.imageryLayer))
      .map(entity => {
        return {
          name: entity.name,
          hash: hashEntity(entity, terria.clock)
        };
      });

    initSources.push({
      pickedFeatures: pickedFeatures
    });
  }
}
function addFeaturePicking ( terria , initSources ) { if ( defined ( terria . pickedFeatures ) && terria . pickedFeatures . features . length > 0 ) { const positionInRadians = Ellipsoid . WGS84 . cartesianToCartographic ( terria . pickedFeatures . pickPosition ) ; const pickedFeatures = { providerCoords : terria . pickedFeatures . providerCoords , pickCoords : { lat : CesiumMath . toDegrees ( positionInRadians . latitude ) , lng : CesiumMath . toDegrees ( positionInRadians . longitude ) , height : positionInRadians . height } } ; if ( defined ( terria . selectedFeature ) ) { // Sometimes features have stable ids and sometimes they're randomly generated every time, so include both // id and name as a fallback. pickedFeatures . current = { name : terria . selectedFeature . name , hash : hashEntity ( terria . selectedFeature , terria . clock ) } ; } // Remember the ids of vector features only, the raster ones we can reconstruct from providerCoords. pickedFeatures . entities = terria . pickedFeatures . features . filter ( feature => ! defined ( feature . imageryLayer ) ) . map ( entity => { return { name : entity . name , hash : hashEntity ( entity , terria . clock ) } ; } ) ; initSources . push ( { pickedFeatures : pickedFeatures } ) ; } }
Add details of currently picked features.
@private
Add details of currently picked features .