Saturday, November 06, 2010

Embedding arcgis.com Web Maps

It's so easy:


View Larger Map

Friday, May 28, 2010

Adding Ant to Flash Builder 4

Things have changed between Flash Builder 4 beta and Flash Builder 4 (final), so I figured just as well update my old blog post.

http://renaun.com/blog/2010/03/31/416/ tells the story. Here's the steps I had to do:

1. In Flash Builder, go to Help -> Software Updates...
1a. If you get a "No Updates Found" popup, press "Yes" to open "Available Software Sites". Note that both Flex Builder 3 and 4 Beta used to have some sites by default. Whatever, we'll just add one ourself.

1b. In "Available Software Sites", click "Add" on right side.
Add "Galileo" as the "Name:".
Add "http://download.eclipse.org/releases/galileo" as the "Location:".
Say "OK" :)

Step 1 - same
In Adobe Flash Builder 4, go to Help -> Install new software.

Step 2
In the first box ("Work with", pick the "Galileo".

Step 3
Below the search results, un-select the "Group items by category".

Step 4.
Among the search results, select "Eclipse Java Development Tools" and click "Next". Click "Next" again. Accept the license agreement and click "Finish".

Monday, April 19, 2010

ASDoc HTML elements - Flash Builder 4

When you update your Flex 3 code to Flex 4, you might also need to update the HTML you have inside your ASDoc.  How to specify HTML elements in asdoc have not changed much between Flex 3 and Flex 4, but still there are some minor things that might trick you up.


For reference, see http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_8.html and http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WSd0ded3821e0d52fe1e63e3d11c2f44bc36-8000.html.


About Ampersand (&)

Flex 3 used "&".
Flex 4 uses "&" and the documentation says to not use the Flex 3 styled "&".


About non-breaking spaces

Both Flex 3 and 4 documentation was clear that you should use " ", but maybe for some reason, like us, you instead had " ". It worked fine in Flex 3 and still works fine in Flex 4 HTML documents. However, if you are in Flash Builder and taking advantage of "fat" swc (asdoc content for inline code hinting and the "asdoc" tab), then only " " works fine. Both " " and " " will show in Flash Builder as " ". So trust the documentation, stick with " " and you will be fine :)

Friday, July 10, 2009

Adding Ant to Adobe Flash Builder 4 Beta

There are good instructions for getting Ant to run in Flex Builder 3 at http://iamjosh.wordpress.com/2008/08/11/adding-ant-to-flex-builder-3/ but I just installed Adobe Flash Builder 4 Beta (the June 2009 version) and things are a tiny bit different. Here are the steps I followed:

  1. In Adobe Flash Builder 4 Beta, go to Help -> Software Updates -> Find and Install...

  2. Select "Search for new features to install" and click Next.

  3. Pick "The Eclipse Project Updates" and click Finish.

  4. If prompted, for "Update Site Mirrors", select "Automatically select mirrors". Click "OK".

  5. In the search results, expand "The Eclipse Project Updates", then expand "Eclipse 3.4.2″.

  6. Select "Eclipse Java Development Tools 3.4.2.r342..." and click "Next".

  7. Accept the license agreement and click "Next".

  8. Click "Finish".

  9. Wait for download...

  10. When prompted for feature verification, select "Install All".

  11. Restart Flex Builder as suggested.

You will now have Ant support installed. All build.xml file will have a little ant icon and if you right-click the file and select "Run as", you will see two Ant options:

  • Ant Build - which also has a keyboard short-cut, but does anyone actually remembers shortcuts like Alt+shift+X,Q ?

  • Ant Build... - which allows you to specify which targets to execute.

Side note: Make sure your Flex workspace don't contain space and Ant should work just fine.

My first error "Unable to access jarfile C:\ArcGIS\FlexAPI2\api\${env.FLEX4_HOME}\lib\compc.jar" was easily fixed by adding a new environment property FLEX4_HOME and setting it to C:\PROGRA~1\Adobe\FLASHB~1\sdks\4.0.0\

Monday, November 24, 2008

Adding Ant to Flex Builder 4 (Gumbo)

There are good instructions for getting Ant to run in Flex Builder 3 at http://iamjosh.wordpress.com/2008/08/11/adding-ant-to-flex-builder-3/ but I just installed Flex Builder 4 (Adobe MAX Preview version) and things seem to have changed a tiny bit. Here are the steps I followed:

  1. In Flex Builder, go to Help -> Software Updates -> Find and Install...
  2. Select "Search for new features to install" and click Next.
  3. Pick "The Eclipse Project Updates" and click Finish.
  4. In the search results, expand "The Eclipse Project Updates", then expand "Eclipse 3.4.1″.
  5. Select "Eclipse Java Development Tools 3.4.1.r341..." and click "Next".
  6. Accept the license agreement and click "Next".
  7. Click "Finish".
  8. Wait for download...
  9. When prompted for feature verification, select "Install All".
  10. Restart Flex Builder as suggested.

You will now have Ant support installed. All build.xml file will have a little ant icon and if you right-click the file and select "Run as", you will see two Ant options:

  • Ant Build - which also has a keyboard short-cut, but does anyone actually remembers shortcuts like Alt+shift+X,Q ?

  • Ant Build... - which allows you to specify which targets to execute.


Side note: Make sure your Flex workspace don't contain space and Ant everything should work just fine.

Monday, September 18, 2006

KML faster than GPX

When using feeds from Motionbased, the KML is 5x faster then GPX because the format is that much more compact. So if you're not using the time stamps, course heading, or speed available in the GPX feed, then using KML feed is probably a good idea.

For example:

<trkpt lat="34.1" lon="-118.2">
    <ele>141.5<ele>
    <time>2006-09-12T05:31:20-07:00</time>
    <course>0.0</course>
    <speed>3.834404896762164</speed>
</trkpt>
<trkpt lat="34.3" lon="-118.4">
    <ele>141.5<ele>
    <time>2006-09-12T05:31:21-07:00</time>
    <course>0.0</course>
    <speed>3.834404896762164</speed>
</trkpt> ...
versus
<coordinates>-118.2,34.1,411.1 -118.4,34.3,411.1 ... </coordinates>

I updated my MB/AWX mashup with this and some other improvements: http://www.bjornman.com/mb-in-awx.html

(The old mashup using GPX instead of KML is now available as http://www.bjornman.com/mb-in-awx-using-gpx.html)

The only tricky part with using KML was the irritating bug in the Mozilla/Firefox xml parser where it only gets the first 4096 character with "firstChild.data". Since an activity is often a lot longer, only the first 112 locations showed on the map. Since newer Mozilla/Firefox (though not IE) supports the "textContent" from W3C DOM Level 3, I fixed it by trying both ways of getting at the full "coordinates".

Friday, September 08, 2006

Showing MotionBased Activities in ArcWeb Explorer

Using RSS and GPX feeds from MotionBased (MB) and displaying them on maps from ArcWeb Explorer is easy. At least if you understand GeoRSS and GPX xml formats, know JavaScript, and one of the JavaScript map API's, like ArcWeb Explorer JavaScript API. The latter being free - at least for "personal, non-commercial, and non-governmental use".

What is Motionbased? ... it's a really cool "web application that translates GPS data into functional analysis and online mapping for endurance and outdoor athletes". For me that means that each time I run or bike, I bring along my GPS toy and then upload the GPS data to Motionbased when I get home.

Motionbased provides user's most recent activities in GeoRSS feeds, so it's easy to display them on the map. They also provide the activities as GPX - "the de-facto XML standard for lightweight interchange of GPS data". This makes it easy to show the exact tracks of every individual activity on a map. Whether you use the API's from Google Maps, Yahoo Maps, Ask.com or ArcWeb Explorer (AWX).

http://www.bjornman.com/mb-in-awx.html?mb=bjorn is the application I created using AWX. It reads the RSS feed with the most recent activities for a user and displays them as markers on the map. You can then click on the activities to read more about it and see the heart rate profile (if available), and to show the exact GPS route of that activity. After clicking the links above the map or the "Show Route" in the marker the GPX data will be downloaded, parsed by the browser and displayed on the map. In addition to being shown above the map, the activities are also listed inside the "Find" box. From there you can drag and drop one or more activities onto the map for it to zoom in to those. Note too that after displaying the route, the marker is updated to show elevation and heart rate profiles.

You can specify any user on the URL line, for example:

Go play!