Select to view content in your preferred language

Switching from Flex to Javascript API

1095
8
04-15-2011 10:45 AM
NickO_Day
Occasional Contributor
I have primarily focused on web development using the Flex API (utilizing Flash Builder), but am thinking about transitioning toward the Javascript API.  The main reason behind this is the need to provide cross-platform accessibility for our main application (we'll still develop using Flex, but those apps will be very task-specific).
Does this logic make sense or am I imagining that Javascript is the silver bullet?  Of the people that are already utilizing the Javascript API, what development environment do you use?  Are there any packages out there that are more WYSIWYG than ones like Aptana?

Thanks in advance!
0 Kudos
8 Replies
MatthewLawton
Deactivated User
You might want to review this post:
http://forums.arcgis.com/threads/23025-Getting-started

Personally, I just use a beefed up text editor for all of my work (http://www.scintilla.org/SciTE.html). I know there are JavaScript IDEs out there, but I have never been comfortable using them.

With HTML 5 coming, I think the JavaScript API is a totally sound development platform.

Good Luck!
0 Kudos
derekswingley1
Deactivated User
Are you talking about accessibility like a11y or are you talking about not needing a browser plug-in to view a site/app?

For editors, I'm a fan of more advanced text editors as opposed to a full blown IDE. On Windows, I like gVIM or Notepad++. On OSX, MacVIM is my preferred choice.

Regarding the WYSIWYG aspect, I would say you don't need this. There's no compilation step in JS development so just save and reload your app in your browser. You'll immediately see your changes.
0 Kudos
derekswingley1
Deactivated User

With HTML 5 coming, I think the JavaScript API is a totally sound development platform.

Good Luck!


I'm going to nit pick a little... What does this really mean? HTML5 is coming?
0 Kudos
MatthewLawton
Deactivated User
I'm going to nit pick a little...


LOL, that's okay, I'm sure I have plenty of nits to pick.

I suppose HTML 5 is "here", although I have not installed IE9 yet so I guess for me it is still coming. My understanding is that HTML 5 will inherently allow more dynamic content to be consumed directly by the browser, thus reducing the need for 3rd party plugins like Flash. I think this will be a good thing for the JavaScript API, but I would love to see a thread created on this topic for further insight and discussion.
0 Kudos
ScottDavis
Frequent Contributor
I'm a big fan of Aptana Studio. The new version 3 looks very good.

For WYSIWYG you could try http://maqetta.org/.
0 Kudos
CarmenDurham
Frequent Contributor
After working with Flex using Flex Builder/Flash Builder, I also needed to create some javascript based apps to work across different environments. 

I was so glad to find Aptana (and the ESRI plugins for code assist).  The IDE is so much like Flash Builder (I guess b/c they are both built on Eclipse or something to that effect) that it has made the transition easier.

Carmen
0 Kudos
Ray_DominicMaldonado
Emerging Contributor
I have primarily focused on web development using the Flex API (utilizing Flash Builder), but am thinking about transitioning toward the Javascript API.  The main reason behind this is the need to provide cross-platform accessibility for our main application (we'll still develop using Flex, but those apps will be very task-specific).
Does this logic make sense or am I imagining that Javascript is the silver bullet?  Of the people that are already utilizing the Javascript API, what development environment do you use?  Are there any packages out there that are more WYSIWYG than ones like Aptana?

Thanks in advance!


I found the link below to be very helpful in my transition (particulary the "mobile" section).  Still getting used to it though, not sure how to add more than one feature layer to the map and have it display in the dynamic legend (it only shows first layer for some reason)...let me know if this helps and if you can figure it out...

http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm
0 Kudos
Ray_DominicMaldonado
Emerging Contributor
I found the link below to be very helpful in my transition (particulary the "mobile" section).  Still getting used to it though, not sure how to add more than one feature layer to the map and have it display in the dynamic legend (it only shows first layer for some reason)...let me know if this helps and if you can figure it out...

http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples_start.htm


by the way here's the code for the one I'm referring to....

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>
      Map with Feature Layer
    </title>
    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2compact">
    </script>
    <style type="text/css">
      html, body
      {
        height: 100%;
        margin: 0px;
        padding: 0px;
        width: 100%;
      }
      .esriSimpleSlider
       div
      {
        height: 30px !important;
        width: 30px !important;
      }
    </style>
    <script type="text/javascript">
      dojo.require("esri.map");
      dojo.require("esri.layers.FeatureLayer");
      dojo.require("esri.tasks.query");

      var map;

      function init() {
        var initialExtent = new esri.geometry.Extent({"xmin":-11878390,"ymin":4598298,"xmax":-11455847,"ymax":5052028,"spatialReference":{"wkid":102100}});
        map = new esri.Map("map", {
          extent: initialExtent
        });
        var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer");
        map.addLayer(tiledMapServiceLayer);

        dojo.connect(map, "onLoad", function(evt) {
          //add a feature layer
        var content = "<b>Name</b>: ${NAME} <br /><b>Population</b>: ${POP2007}";

        var infoTemplate = new esri.InfoTemplate("County Details", content);
        map.infoWindow.resize(225,75);
        var featureLayer = new esri.layers.FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3",{
          mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
          outFields: ["NAME","POP2007"],
          infoTemplate: infoTemplate
        });
        featureLayer.setSelectionSymbol(new esri.symbol.SimpleFillSymbol().setColor(new dojo.Color([254,216,93,.60])));
        dojo.connect(featureLayer,'onClick',function(evt){
          //select the clicked feature
          var query = new esri.tasks.Query();
          query.geometry = evt.mapPoint;
          featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
         
        });
        map.addLayer(featureLayer);
        });
      }

      function orientationChanged() {
        console.log("Orientation changed: " + window.orientation);
        if(map){
          map.reposition();
          map.resize();
        }
      }


      dojo.addOnLoad(init);
    </script>
  </head>
 
  <body onorientationchange="orientationChanged();">
    <div id="map" style="width:100%; height:100%;">
    </div>
  </body>

</html>
0 Kudos