Closed cmccullough2 closed 7 years ago
@cmccullough2 Perhaps this contributed widget will meet your needs. https://github.com/ERS-Long/PointClustering
@cmccullough2 Did that widget meet your needs?
Sorry for the delayed response. This is not working for me. The only thing that is different in the config is buildImageParameters vs. ImageParameters based on the example. I am not sure if this is the issue.
I am not getting any error messages in the developer tools. I am building this with the CMV WAB template.
Viewer:
{
type: 'dynamic',
url: 'https://{airliftstatus}/gis/rest/services/Logistics/AircraftStatus/MapServer/',
title: 'Airlift Status',
options: {
id: 'airliftStatus',
opacity: 1.0,
visible: true,
imageParameters: buildImageParameters({
})
},
identifyLayerInfos: {
layerIds: [0]
},
layerControlLayerInfos: {
swipe: true,
metadataUrl: true,
expanded: false,
menu: [{
label: 'PointClustering',
topic: 'clusterMap',
iconClass: 'fa fa-search fa-fw'
},{
label: 'Remove PointClustering',
topic: 'removeClusterMap',
iconClass: 'fa fa-search fa-fw'
}]
},
legendLayerInfos: {
layerInfo: {
hideLayers: []
}
}
}
Widget Configuration: clusterMap: { include: true, id: 'clusterMap', type: 'invisible', //titlePane, invisible canFloat: true, title: ' clusterMap', path: 'widgets/PointClustering', position: 30, open: false, options: { map: true, } },
Hi, @cmccullough2
Please plug in your service to this
https://github.com/Esri/cluster-layer-js
to see if it works or not. I used that to find one of the my service's issue.
On the latest version of cmv, the topic changed in Layer Control :( this line the topic should be changed to layerControl/...
@roemhildtg good catch.
I just noticed that a couple of my widgets were no longer working
yep. as you noted in the original PR #503, this is a breaking change.
Is it safe to assume I need to make the same changes on line 143, topic.subscribe('layerControl/removeClusterMap', function (r) {
yes it is.
Yes, confirmed, if using the updated layercontrol, then we need to adjust that topic to use (layerControl) instead of (LayerControl). Also need to test the map service, the GIS guy had to change something for one of the layers, otherwise it does not draw the cluster. I forgot what it was exactly, if i remember it correctly it is something about the underneath database thing.
Thanks
It is worth pointing out that in the cmv develop branch, you can add your own custom layers directly in the operational layers array. So in theory, you could add a ClusterLayer when the application initializes without using the sublayer menu item. Untested, so your mileage may vary...
I vaguely remember seeing something about that, are there cmv docs on adding a custom layer type?
On Sep 21, 2016 17:18, "Tim McGee" notifications@github.com wrote:
It is worth pointing out that in the cmv develop branch, you can add your own custom layers directly in the operational layers array. So in theory, you could add a ClusterLayer when the application initializes without using the sublayer menu item. Untested, so your mileage may vary...
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cmv/cmv-app/issues/587#issuecomment-248759584, or mute the thread https://github.com/notifications/unsubscribe-auth/AFN7Zx4VJDRVTobqMY8TInXjOKzja-x2ks5qsa1MgaJpZM4Jl0Bf .
@roemhildtg documentation? surely you jest! ;)
https://github.com/cmv/cmv-app/blob/develop/viewer/js/config/viewer.js#L98
Here's another interesting implementation of point clustering that should be fairly easy to integrate within a CMV application.
Thanks @tmcgee for the link about this very beautiful clustering example, did a quick test integration in CMV using the exact data, yes, it is very straightforward and it is working just fine.
To use this cluster method for map service, still need to get the json data from the map service, I guess.
:smile: I'll see if I can find some time to write some docs on that before the big 2.0 release
:+1:
Has anyone tried to 'cluster' point features in the CMV?