Beginner Guide to Javascript and Widgets

989
7
01-07-2021 02:20 AM
higgy7
by
New Contributor III

Hi,

I am a complete newbie to Javascript, I normally use WAB and WAB Developer. Is there anyway to use the point clustering talked about in this blog:

https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/summarize-and-explore-point-clusters...  

Within WAB? I don't think I have the access to install  ArcGIS API for JavaScript . Is there someway to put this:

https://developers.arcgis.com/javascript/latest/sample-code/featurereduction-cluster/index.html 

In a widget and bring it into WAB for the user to use.

Thanks in advance!

0 Kudos
7 Replies
shaylavi
Esri Contributor

Both links refers to the javascript API version 4.x. WebApp Builder is based on version 3.x of the API.

So referring to what presented in the links, the answer is no. You can however, use the available cluster options available for version 3 of the API as explained here - https://developers.arcgis.com/javascript/3/jssamples/layers_point_clustering.html

And of-course the functionality can be wrapped as part of a widget in the Dev' edition.

 

Shay
0 Kudos
higgy7
by
New Contributor III

Hi Shay, 

 

Thanks for the quick response. Is there any guide on how to do this? For example when i download the info from that link, the folder structure is as follows:

higgy7_0-1610017208532.png

The apps i would use have a structure similar to this:

higgy7_1-1610017270037.png

Are there other steps i would have to take? Sorry about my lack of knowledge!

 

0 Kudos
shaylavi
Esri Contributor

I don't really understand what you're trying to achieve.

If it's just to display a layer as clusters, you don't need a widget or WAB, you just configure the layer to be shown as cluster layer through a webmap at Portal and consume that layer as you do through WAB.

If you would like to build a new custom widget that will display a layer/data as clusters that's quite an effort and you need to learn how to create custom widgets first and there are many guides to this that can help you, but it sounds like you just want to configure a layer with cluster symbology through a webmap on Portal.

Shay
0 Kudos
higgy7
by
New Contributor III

What i would have liked is to have a widget where the user could display the data as clusters but you have stated what i thought that i would have learn how to create custom widgets.

To display the layer with cluster symbology through a webmap on Portal is this just using the heatmap symbology or is there another way to symbolise?

0 Kudos
shaylavi
Esri Contributor

For a point layer there should be a separate button to define a cluster view of the layer - it's not part of the symbology config screen you mentioned that lets you choose a heatmap view.

For a polygon/polyline, you should be able to see the clustering setting under that symbology config window.

If you're just learning on custom widgets, I would start with the basics before jumping to showing a cluster layer -

The widget will need to be hosted on an IIS server at some point if you're publishing it to users so that's also something to be aware of and see if you can even do that (host it on an IIS server).

Once you create a widget and add it, you can add a button and then see if you can add a new layer to the map with a button click, which then you'll be able play-around and applying different symbologies or renderers to that layer.

Shay
0 Kudos
higgy7
by
New Contributor III

Prefect thanks again for all the help. I have used custom widgets that other users have created so I am familiar with hosting on an IIS server etc.

 

Once again thanks for the help and information!

0 Kudos
shaylavi
Esri Contributor

Good luck

Shay
0 Kudos