Select to view content in your preferred language

Javascript API mirroring ArcGIS.com

672
2
12-12-2012 11:29 AM
DonaldCatanzaro
Emerging Contributor
Hi All,

Prior to my working on this project, we had and Javascript API web mapping application.  At some point, they decided to switch the application to consuming maps via the ArcGIS.com viewer.

Right now, the web page uses an iframe to consume the ArcGIS.com map and some other folks have spent tons of time tweaking it (especially the pop-ups, links to metadata etc).

The problem that I have is that the ArcGIS.com viewer is fairly basic and you cannot customize very many things.  For instance, I would like to be able to draw a polygon on the screen and get custom reporting out, I would also like to be able to have more sophisticated pop-ups (e.g. javascript calculations).

The ability to draw on the map and get reporting out is a javascript/database function I've seen in other websites so I know it can be done, plus I was thinking of linking it through Business Analyst anyway.

So my question is this:

How can I most efficiently get what I want?  Can the Javascript API handle/accept the pop-up stuff that was done in ArcGIS.com ?  I don't want to redo all the work that is already done on the pop-ups but I need more capabilities than the ArcGIS.com viewer.

Thanks !
0 Kudos
2 Replies
JohnGravois
Deactivated User
have you seen our JavaScript API samples related to web maps?  they demonstrate how to reference an arcgis.com web map by id and pull the layers (popups and all) into a custom application.

this specific sample demonstrates how to pass one of the operational layers from the web map to a newly instantiated legend widget.  this affirms that it is possible to write code to support additional functionality on top of what is available in arcgis.com

map = response.map;
...
//add the legend
var layers = response.itemInfo.itemData.operationalLayers;
...
if(layerInfo.length > 0){
          var legendDijit = new esri.dijit.Legend({
            map:map,
            layerInfos:layerInfo
          },"legend");
0 Kudos
DonaldCatanzaro
Emerging Contributor
Many thanks !

-Don
0 Kudos