Status
screenshots/videos/online info? /cc
Location
Washington, DC
Subscribe to GeoRSS Subscribe to KML


Javascript

GeoRSS to GoogleMaps

Published in Javascript, Maps, Open-Source, Programming, Technology, Web


Mikel Maron wrote up a small Javascript class to parse a GeoRSS marked XML file and display the points with GoogleMaps. You can see MGeoRSS here. It currently just handles the W3C format for RSS (example of usage for earthquakes).

-21.1765169.5617

In response to his posting to the GeoRSS mailing list, I added a
GeoRSS Simple parsing class.

45.256 -71.92

Still need to add the full GML spec which calls out boxes, polygons, lines, etc. In addition, the ability to automatically detect and parse the correct format (Atom, RSS 0.92, RSS 1.0, RSS 2.0; GML, Simple, W3C) would be really nice.


MacTech Article: Adding Ajax to a Website

Published in Ajax, Article, Javascript, Programming


MacTech January 2006 coverThe month is half over and I have failed to mention that you can go to your local (geeky) news stand and pick up the January issue of MacTech Magazine featuring my article “Adding Ajax to a Website”.

The article covers how to simply implement Ajax on a website and understand the basic principles behind the Asyncronous communications. Hopefully it can shed some light to developers new to writing Ajax supporting sites and then move on to the more advanced frameworks (such as prototype, Rico, or xajax and others).


How to create geolocated posts in Blogger

Published in Environment, Geolocation, Javascript, Web


GreenerMaps screenshotI’m helping out on a project, GreenerEarth, which is a location companion site to the GreenerMagazine set of environmental weblogs.

For various reasons, they’re using Blogger to currently run their weblogs since it’s free, easy to setup, and easy to use for non-technical people.

The goal of GreenerEarth was to create a companion weblog that provided maps and locations to the various articles that will appear on GreenerEarth. The difficulty resides in the severe restrictions using an hosted blogging tool places on creating a dynamically generated maps. I wanted to allow the writers to easiliy create new posts, put in locations, and then just ‘post’. The actual page would handle parsing the post for the location data and then creating the resulting map.

The only access you have in Blogger (at least) is the main template page, and post templates. Therefore, the solution calls for a marked-up post with lots of tags, and heavy Javascripting of the DOM to dynamically create an array of locations and put these on a GoogleMap.

The result is the ability for any blog author to write a post using the template and the resulting post to have a map with the multiple (or single) locations and article body. As the user clicks on locations in the map, the detailed description shows itself and a bubble shows the summary and link to the site’s homepage.

The nitty-gritty

The post template looks like this:


The fields should be pretty self-explanatory. The GeoRSS microformat is still being standardized, and hasn’t yet been defined for marking up XHTML content. So I made an ad-hoc solution. A filled out post would then look like so:


Sustainable Diamaonds
Diavik diamond mines are sustainable Mines located in the Northwest Territories.
Diavik diamond mine
Lac de Gras
Northwest Territories
Canada
Some Interesting information about Diamond mines

If you have multiple locations, copy the template before the

and paste it below the previous location (or in the desired order). You can add as many locations as you want. Each location will show up as locations with connecting lines on the map.

Somewhere in your template you should add the following to actually place your map. You can vary the size as desired here.


the nitty-gritty

To grab the code below in a simple form, download the source code here.

The following Javascript goes at the bottom of the Blogger template. What it does is search through the DOM (the post) and pulls out all of the location elements and then creates an array of the latitude and longitude values of the location. The summary and link are placed within the GoogleMaps popup window and then the rest of the actual location information shows or hides itself in the right-hand sidebar.


“;

var marker = createMarker(locationPoints[locationPoints.length-1], i, html, mapLocation[i]);

map.addOverlay(marker);

}
map.addOverlay(new GPolyline(locationPoints));
map.centerAndZoom(locationPoints[0], 4);

}

Finally, the appropriate CSS markup also needs to be placed in the template. Modify it as you want to make it match the rest of your blog.


#map {
    float: left;
    text-color: black;
    font-size: 12px;
    }
#map .mapMarker{
  color: black;
  width: 250px;
}

#map .mapMarkerMore {
  text-align:right;
}
.location {
    font-size: 12px;
    border: 1px solid white;
    background-color: gray;
    padding-left: 5px;
    }
.location .summary {
    color: white;
    font-size: 16px;
    border-bottom: 1px solid white;
    background-color: #9ad;
    margin-left: -5px;
    padding-left: 5px;
    display:block;
    }
.location .detail {
	display: inline;
    }
.geo_name {
    font-size: 11px;
    border-bottom: 1px;
    }

.geo_city, .geo_region, .geo_country {
    display: inline;
    margin-top: 4px;
    padding-right: 3px;
    font-size: 9px;
    border-top: 1px solid white;
    text-align: right;
    }

.greenNav {
	display: inline;
	list-style-type: none;
	padding-right: 5px;
	margin: 0px;
    }
.greenNav li {
	display: inline;
	list-style-type: none;
	border-right: 1px solid gray;
	padding-right: 5px;
    }
.hidden {
    display: none;
     }

Javascript Controls

Published in Javascript, Programming, Web


Earlier I discussed Web-based Desktop Interfaces which do lots of various tricks in lots of various ways to provide a consistent (at least with respect to computer users’) user experience. How do they do that you ask?

Here is a very nice javascript slider. It’s released under various licenses including GPL, a non-commerical free license, and a commerical $ license.

It’s very simple to use, requires including 3 javascript files (24k) and a css file. Check the docs out for more info. While there, checkout their other cool UI elements such as collapsable trees, sortable columns, and very good articles on a host of web development technologies.

The same developers also produce Bindows, which is a full, desktop type set of user interface elements usable to create an entire application interface. It’s a little on the expensive side for a commercial license. However, doing these elements on your own dev time, and making them fast and cross-browser compatible is not going to be easy.

You can also check out the Script.aculo.us – the modern, cool Javascript library built on Prototype SliderDemoOther Javascript interface libraries:


MapBuilder – Open-source GIS

Published in Javascript, Maps, Technology, Web


mapbuilder-lib is a browser based (AJAX) web mapping client for Open GIS Services. The tool set allows developers to provide map interfaces of arbitrary datasets without requiring the now infamous online maps). It also supports time series maps (such as for weather, migration, travels)

The underlying server is available in both PHP and JSP, depending on your particularly preferred flavor. Hrm – no Ruby support. They could probably get a better headline if they provided the new programming language of the month(s).

I think having invigorated, open-source, web-based mapping tools is excellent. I also really like the time-series maps. I think I am going to try and use it for displaying GPS tracks from my bluelogger.