Select to view content in your preferred language

Make a Web Application Sharing Feature

2781
3
09-23-2011 07:33 AM
KenDeeds
Regular Contributor
I've had a client that wants to use a lot of different maps and set up a lot of feature layers from those maps with cool info when you click on x or y.  Building our own admin to dissect maps and pull out these layers and allowing users to format what show up in the popup makes no sense for us.  Using explorer.arcgis.com is allowing the client to do all this and it is an AWESOME application I hope doesn't go away.

The issue I've run into is when you click "Make a Web Application" under the "Sharing" is it gives me 14 templates to choose from, and they are all somewhat pre-styled.   I've nit-picked a few apart and made pages that look nothing like the starting template.  But is it possible to add a template with no formatting?  For example, there would only be say 6 divs between two html tags and no style.  Divs like "map", "title", "description", etc....   As a developer just having a white page with the minimal number of divs to hold the information about the map would be so powerful and so easy to use.  Clients all wan't something custom and don't want a pre-formated look, and it is a bit tedious finding all the style properties and changing them right now.  Is there a chance you'll be adding just a plain white template with truly no pre-formatting or style injected into it?

Also will this service continue to exist?  It is so cool to be able to have clients build these awesome maps at explorer and then to be able to showcase them in custom sites for the client.  What makes me nervous about doing sites using this method is not knowing how committed esri is to this sharing technology or application.  I've noticed that the using the share templates take in a key and use initMap();.  This then creates a map object that can be referenced with "map".  Will this "initMap" function always work as it does now?  If not what I'm building will leave me and my clients without jobs if the plug is pulled and I'm not sure this is a good route for my company or clients.
0 Kudos
3 Replies
thadwester
Deactivated User
Great question.  Worries me too, especially since they seem to be moving more towards arcgisonline platform.

I wonder then if the explorer maps can be moved over to arconline?
0 Kudos
John_S
by
Frequent Contributor
Well, if you're looking for a completely custom & configurable web application, you can use the share templates like you're talking about, but it might honestly be easier for you to just build your own web application.  The API's are available at: http://resources.arcgis.com/content/web/web-apis.  For example, you could build a javascript application (they have sample code and a thoroughly documented api), using all your own CSS, HTML, and JavaScript code so you have control over it all.  They even have support in that for customizing pop-up dialog boxes and such as that.  So, if you're wanting more customization, a webapi might be what you're looking for.

In response to using arcgisonline or arcgis explorer online, they're the same thing basically.  They are just offer different interfaces for working with the same maps, layers, data, etc...  At least that's been my understanding of it all.  For example, if you put together a map on explorer.arcgis.com and save it, then search at arcgis.com, it's all there.
0 Kudos
KellyHutchins
Esri Notable Contributor
Ken,

The templates available in the template gallery were all built using the ArcGIS API for JavaScript so the functionality for creating a new map based on a web map id is not going to go away. As jstreeb pointed out you can visit the web api help pages for details on building completely custom applications. 

Here's an example of a simple layout built using the ArcGIS API for JavaScript that has minimal styling. This layout works with a web map from ArcGIS.com. To view the layout with different web maps replace the value for webmap in the code with your web map id. The 'sections' of this layout were created using Dojo's layout widgets - you can read about the layout widgets here:
http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/inside_dojoLayouts.h...

View application running here:
http://jsfiddle.net/khutchins/sXPTE/1/embedded/result/

And here's the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html> 
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=7, IE=9" />
    <!--The viewport meta tag is used to improve the presentation and behavior of the samples 
      on iOS devices-->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
    <title>
    </title>
    <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/dojo/dijit/themes/Nihilo/Nihilo.css">
    <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/esri/dijit/css/Popup.css">
    <style type="text/css">
      html,body {
        height:100%;
        width:100%;
        margin:0;
        padding:0;
      }

      body {
      overflow:hidden;
      }

      #header {
        height:55px;
      }
      #footer {
        height:30px;
      }

      #rightPane {
        width:20%;
      }

      #leftPane {
        width:150px;
      }
    </style>
    <script type="text/javascript">
      var dojoConfig = {
        parseOnLoad: true
      };
    </script>
    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5">
    </script>
    <script type="text/javascript">
      dojo.require("dijit.dijit"); // optimize: load dijit layer
      dojo.require("dijit.layout.BorderContainer");
      dojo.require("dijit.layout.ContentPane");
      dojo.require("dijit.layout.AccordionContainer");
      dojo.require("esri.IdentityManager");
      dojo.require("esri.map");
      dojo.require("esri.arcgis.utils");
      
      var map;

      function init() {

        var urlObject = esri.urlToObject(document.location.href);
        var webmap = "59357ba9bd06409a99c0eb89f9089a40";

        if (urlObject.query) {
          webmap = urlObject.query.webmap;
        }
        
        var mapDeferred = esri.arcgis.utils.createMap(webmap, "map", {
          mapOptions: {
            slider: true
          },
          geometryServiceURL: "http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
        });
        mapDeferred.addCallback(function(response) {     
          map = response.map;
          //resize the map when the browser resizes
          dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
        });
        mapDeferred.addErrback(function(error) {
          console.log("Map creation failed: ", dojo.toJson(error));
        });

      }


      //show map on load 
      dojo.addOnLoad(init);
    </script>
  </head>
  
  <body class="nihilo">
    <div id="mainWindow" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline'"
     style="width:100%; height:100%;">
      <div id="header" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'top'">
        <div id="title">
          Title goes here 
        </div>
        <div id="subtitle">
          Sub title goes here 
        </div>
      </div>
      <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'left'" id="leftPane">
        <div data-dojo-type="dijit.layout.AccordionContainer">
          <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'pane 1'">
            Content for pane 1
          </div>
          <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'pane 2'">
            <p>
              Content for pane 2
            </p>
          </div>
          <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'pane 3'">
            <p>
              Content for pane 3
            </p>
          </div>
        </div>
      </div>
      <div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
      </div>
      <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'right'" id="rightPane">
        This is the right section
      </div>
      <div id="footer" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">
        This is the footer section
      </div>
    </div>
  </body>

</html>

0 Kudos