CUAHIS-HIS
RSS

Navigation





Quick Search
»
Advanced Search »

PoweredBy

DASH - Customization

RSS
Modified on 2008/07/01 16:22 by kimschreuders Categorized as DASH, How To

Adding Localized data to the BaseMap


The DASH application is provided with National scale data sets. The BaseMap document is provided to get your started with an application that has the minimum level of content required to work with the national level observation networks. However, it is the intention that you will customize the application for your locale.

Hopefully you have GIS data which is more specific to your local region which you will want to add to the BaseMap.
  • Make a copy of the BaseMap.mxd - just for back up.
  • Open BaseMap.mxd and add your layers
  • Symbolize your layers
  • Set scale limits on your layers
    There are two very important reasons why you should be sure to set scale limits on your GIS layers.
    For example assume you have a detailed streets layer for you local area:
    • Performance - drawing this layer at all scales will increase the draw time as you zoom out.
    • Cartography - drawing this layer at all scales will look terrible and will likely obscure more relevant data.
    • To set the scale, right click on the layer in the Table of Contents and select "properties." On the "general" tab of the dialog that opens, you will find the option to select a scale at which the layer will not draw.





Changing the Default extents


The default behavior for the application when it is first launched is to zoom to the union of the initial extents of all the map services. If you want to change the initial extent, you have two options:
  • Option #1 change the default extent of all the mapservices.
    • For each service that is used, Open the mxd files in ArcMap
    • Right – click on “Layers” in the TOC and select properties.
    • Select the “data frame” tab.
    • At the bottom you will see “Extent used by full extent command” click the other radio button, then the specify extent button
    • Several methods to specify the extent are available, choose however you like, then make sure to hit OK, OK, and then save the document.
    • In ArcCatalog, restart the service.

  • Option #2: Programmatically set the initial extent in the default.aspx.vb file to override the default behavior.
    • Start Visual Studio
    • Open the dash application as a “Web Site” (Local IIS)
    • Open the default.aspx.vb file
    • Locate the method “Page_PreRenderComplete”
    • Add the line to specify the extent as shown in the highlighted text below.
    • The order of the coordinates is important: xmin, ymin, xmax, ymax.
    • Save the file
    • Rebuild the application


  Protected Sub Page_PreRenderComplete(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.PreRenderComplete
    ' If no tasks have been defined, hide the tasks panel
    If TaskMenu.Items.Count = 0 Then Tasks_Menu_Panel.Visible = False
    ' check to see if any of the resource items are non-pooled
    If Not Page.IsCallback Or Not Page.IsPostBack Then
      CloseHyperLink.Visible = HasNonPooledResources()
      Dim ov As OverviewMap = Page.FindControl("OverviewMap1")
      If Not ov Is Nothing Then
        If Not OverviewMapResourceIsValid(ov) Then
          ov.OverviewMapResource = Map1.PrimaryMapResource
        End If
      End If
       Map1.Extent = New ESRI.ArcGIS.ADF.Web.Geometry.Envelope(-117.268, 32.71, -116.961, 32.91)     
    End If
    CopyrightTextHolder.Visible = HasCopyrightText()
  End Sub 'Page_PreRenderComplete





Caching your service

  • Advantages
    • Faster display - map images do not need to be created on demand
    • Richer Cartography - You can enhance the cartography as much as you like without the penalty to performance because the images are created up front.
  • Disadvantages
    • You can only zoom in or out as far as you have cached the data.
    • Caching the data can take time and disk space
    • Layers within the cached service cannot be turned off individually.
  • How to build a Map Service Cache
    ArcGIS Server Online Help


    Map caching tips and tricks



Setting up a Second DASH

DASH is so much fun, that sometimes you can't have just one. Here are quick instructions for setting up a second DASH.

In windows explorer:
  • Copy the “DASH” folder and paste it to the desired location for the second DASH.
  • Rename it from “Copy of DASH” to DASH2.
  • Set the folder permissions. Everyone:read; ASPNET, ArcGISSOC:full control.

In IIS manager:
  • Add a virtual directory pointing to DASH2.
  • Open properties for this virtual directory.
    • On the “Virtual Directory” tab, click the button “Create” so it will be a “web application”.
    • On the “Directory Security” tab, click the button “Edit.”
      • Check the box to “Allow anonymous access” .

Expanding the Map Contents Window by Default

The Map Contents window shows the layers and symbology in your map. It is not expanded by default in order to save space on the screen. You can set the default behavior for this by editing default.aspx in the DASH code, and then recompiling the code.

To expand the Map Contents window by default:
  1. Start Visual Studio 2005.
  2. Click File, point to Open, and then click Web Site.
  3. Make sure Local IIS is selected on the left, and then browse to DASH, and click Open.
  4. Once the DASH source code loads, open default.aspx by double clicking it in the project explorer.
  5. If you do a search for "map contents" in that document, it should take you to the part of the code that begins with a comment that looks something like <!- TOC ... Map Contents ->.
  6. In the esri:FloatingPanel element, you'll see an attribute called Expanded, with a value of "False". Change this to "True".
  7. To set the height of the Map Contents window, in the esri:FloatingPanel element, you'll see an attribute called Height, which has a value of something like "150px". Change this to something bigger, like "450px".
  8. To set how deep the expanded items go (do you show legends for top level layers, or for all grouped items, etc.), in the esri:Toc element, which is a child of the current esri:FloatingPanel element, you'll see an attribute called ExpandDepth. To show the symbols for the first level of map layers, give that attribute a value of "2". You get the idea.
  9. Press Ctrl-Shift-B to build the solution.
  10. Open a browser, navigate to your DASH, and make sure the Map Contents window is expanded. If you do more code adjustments and recompile, it's best to close your browser and open a new one in order to see the changes that you made in the code.

Note: You can also change these settings by changing the properties of the Map Contents window and the TOC is contains, from the Designer view. To do so, right click on default.aspx and click View Designer. Then left click on the Map Contents window to select it, and now the properties (such as "Expanded") should be visible in the Properties window.

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam.