diff --git a/packages/geoview-core/public/templates/demos/demo-function-event.html b/packages/geoview-core/public/templates/demos/demo-function-event.html
index fb0c44b6659..3a42a289674 100644
--- a/packages/geoview-core/public/templates/demos/demo-function-event.html
+++ b/packages/geoview-core/public/templates/demos/demo-function-event.html
@@ -96,7 +96,7 @@
API Functions:
cgpv.api.maps.Map1.layer.setAllLayersVisibility(false)
Rename Water Quantity layer
- cgpv.api.maps.Map1.layer.setLayerName('uniqueValueId/1', 'Water Quantity')
+ cgpv.api.maps.Map1.layer.setLayerName('Water Quantity')
Place a marker on map
cgpv.api.maps.Map1.clickMarkerIconShow({lnglat: [-90, 60]})
@@ -304,7 +304,9 @@ Events that will generate notifications:
});
// listen to individual layer loaded event
- cgpv.api.maps.Map1.layer.getGeoviewLayerHybrid(LYR_PATH_NON_METAL)?.onIndividualLayerLoaded((sender, payload) => {
+ // TODO: The gv layer does not exist at the time we attach the event. To make this work, we would
+ // TODO.CONT: need to implement a when-this-then internal approach.
+ cgpv.api.maps.Map1.layer.getGeoviewLayer(LYR_PATH_NON_METAL)?.onIndividualLayerLoaded((sender, payload) => {
cgpv.api.maps.Map1.notifications.addNotificationSuccess('Nonmetal mines has finished loading');
console.log(sender.olRootLayer.getSource().getFeatures());
});
@@ -331,22 +333,22 @@ Events that will generate notifications:
// !!
// listen to layer visibility changed event (individual geoview layer)
- cgpv.api.maps.Map1.layer.getGeoviewLayerHybrid(LYR_PATH_UNIQUE)?.onVisibleChanged((sender, payload) => {
+ cgpv.api.maps.Map1.layer.getGeoviewLayer(LYR_PATH_UNIQUE)?.onVisibleChanged((sender, payload) => {
cgpv.api.maps.Map1.notifications.addNotificationSuccess(`${LYR_PATH_UNIQUE} visibility set to ${payload.visible} - individual`);
});
// listen to layer visibility changed event (individual geoview layer)
- cgpv.api.maps.Map1.layer.getGeoviewLayerHybrid(LYR_PATH_GEOCORE)?.onVisibleChanged((sender, payload) => {
+ cgpv.api.maps.Map1.layer.getGeoviewLayer(LYR_PATH_GEOCORE)?.onVisibleChanged((sender, payload) => {
cgpv.api.maps.Map1.notifications.addNotificationSuccess(`layer ${payload.layerPath} visibility set to ${payload.visible} - individual`);
});
// listen to layer opacity changed event
- cgpv.api.maps.Map1.layer.getGeoviewLayerHybrid(LYR_PATH_UNIQUE)?.onLayerOpacityChanged((sender, payload) => {
+ cgpv.api.maps.Map1.layer.getGeoviewLayer(LYR_PATH_UNIQUE)?.onLayerOpacityChanged((sender, payload) => {
cgpv.api.maps.Map1.notifications.addNotificationSuccess(`${payload.layerPath} opacity changed to ${payload.opacity}`);
});
// listen to layer filter applied event
- cgpv.api.maps.Map1.layer.getGeoviewLayerHybrid(LYR_PATH_UNIQUE)?.onLayerFilterApplied((sender, payload) => {
+ cgpv.api.maps.Map1.layer.getGeoviewLayer(LYR_PATH_UNIQUE)?.onLayerFilterApplied((sender, payload) => {
cgpv.api.maps.Map1.notifications.addNotificationSuccess(`Filter ${payload.filter} applied to ${payload.layerPath}`);
});
@@ -454,7 +456,7 @@ Events that will generate notifications:
// add an event listener when a button is clicked
renameLayerButton.addEventListener('click', async () => {
- cgpv.api.maps.Map1.layer.setLayerName(LYR_PATH_UNIQUE, 'Water Quantity')
+ cgpv.api.maps.Map1.layer.setLayerName('Water Quantity')
});
// Place Marker Button========================================================================================================
diff --git a/packages/geoview-core/public/templates/demos/demo-geojson-inject.html b/packages/geoview-core/public/templates/demos/demo-geojson-inject.html
index 9de3a12ae7e..eab1468c421 100644
--- a/packages/geoview-core/public/templates/demos/demo-geojson-inject.html
+++ b/packages/geoview-core/public/templates/demos/demo-geojson-inject.html
@@ -97,15 +97,15 @@ API Functions:
Place points set 1
- cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource('geojsonLYR1/blank.json', points1)
+ cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource(points1)
Place points set 2
- cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource('geojsonLYR1/blank.json', points2)
+ cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource(points2)
Place points set 3
- cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource('geojsonLYR1/blank.json', points3)
+ cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource(points3)
@@ -172,7 +172,7 @@ API Functions:
};
// add an event listener when a button is clicked
addPoints1Button.addEventListener('click', () => {
- cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource('geojsonLYR1/blank.json', points1);
+ cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource(points1);
});
// Add points 2 button ====================================================================================
@@ -184,7 +184,7 @@ API Functions:
// add an event listener when a button is clicked
addPoints2Button.addEventListener('click', () => {
- cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource('geojsonLYR1/blank.json', points2);
+ cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource(points2);
});
// Add points 3 button ====================================================================================
@@ -243,7 +243,7 @@ API Functions:
};
// add an event listener when a button is clicked
addPoints3Button.addEventListener('click', () => {
- cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource('geojsonLYR1/blank.json', points3);
+ cgpv.api.maps.LYR1.layer.getGeoviewLayer('geojsonLYR1/blank.json').overrideGeojsonSource(points3);
});