how to pass parameters like combobox selected items into module from html page and how to call back that module into html page in arcgis api for javascript, Please give me some sample code to learn.
.
If you are looking for creating user modules and using them in your application, check out:
Point clustering | ArcGIS API for JavaScript
So, at the top of the main application, you'll see a script tag for dojo config:
<script>
// helpful for understanding dojoConfig.packages vs. dojoConfig.paths:
// http://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/
var dojoConfig = {
paths: {
extras: location.pathname.replace(/\/[^/]+$/, "") + "/extras"
}
};
</script>
The "extras" param will specify the directory to pull the modules. You can then include it like you would an Esri/dojo module:
var map;
require([
"extras/ClusterLayer"
], function(
ClusterLayer
) {
Here's where the module lives - http://developers.arcgis.com/javascript/samples/layers_point_clustering/extras/ClusterLayer.js. Then, you can instantiate and interact with the module:
// cluster layer that uses OpenLayers style clustering
clusterLayer = new ClusterLayer({
"data": photoInfo.data,
"distance": 100,
"id": "clusters",
"labelColor": "#fff",
"labelOffset": 10,
"resolution": map.extent.getWidth() / map.width,
"singleColor": "#888",
"singleTemplate": popupTemplate
});
clusterLayer.setRenderer(renderer);
map.addLayer(clusterLayer);
Hope this helps!