re-write Silverlight application in Javascript

3375
15
06-27-2016 11:27 AM
BrianFoley1
New Contributor II

I have been asked to re-write a ArcGIS Silverlight application in JavaScript.  Below is a picture of what the application looks like in Silverlight.  Is this even possible ?  I've been trying to create the toolbar across the top, with the drop-down menus AND the table of contents that can turn on/off layers.  I've seen a lot of the templates on the ArcGIS Developer's website, but none seem to do anything similar to what I'm trying to accomplish.  Has anyone done something similar ?  Thanks.

0 Kudos
15 Replies
BrianFoley1
New Contributor II

Thanks Manuel, I’ll take a look at those. I’m sure I’ll have a few more questions in the next few days or so.

0 Kudos
BrianFoley1
New Contributor II

You put the Map Legend in your toolbar. Does this legend turn off/on layers ? Is there any high level code you can send me that I can take a look at ?

0 Kudos
ManuelGranados
New Contributor II

Yes, in an earlier version it did. You can hide/show, add/delete layers. You have to pay attention to:

1. Keep a list of the layers and their status (hidden/show)

2. Each layer is represented by a RadioMenuItem (keep a list of these) that displays name and status. Add/delete the RadioMenuItem and/or modify the status depending of what the user selects

3. If the users wants to hide/show use Layer.setVisibility(true/false)

4. If the user wants to delete/add a layer use Map.addLayer/removeLayer and modify the list of layers and RadioMenuItem

5. Also, you have to consider the array of layers in the legend and modified it accordingly

In the version that I am currently working on, the visibility of the layers is managed in the Table of Contents. Here I keep a list of legends (each is presented to the user with a CheckBox) and their corresponding layer.

0 Kudos
BrianFoley1
New Contributor II

This is what I have so far.  I'm struggling on getting the table of contents (in the left-hand pane) to show up under the 'Identify Tools'  menu-item.

0 Kudos
ManuelGranados
New Contributor II

I’m not sure if you can do that (attach the legend to the menu item). I didn’t attached the legend, I attached RadioMenuItem/CheckedMenuItem with the layer’s names.

0 Kudos
BrianFoley1
New Contributor II

I'm getting closer.  Is there a way to separate the color image and the text for a layer ?   I want the text to warp, but don't want it to show up under the image.  I want it to be under the existing text.

0 Kudos