[Geowanking] gmaps XML schema

Brian Lalor blalor at bravo5.org
Thu Jul 14 17:04:24 PDT 2005


Hey all.  I've spent the last couple of days immersing myself into  
the world of XML Schema (yes, I can hear the sighs of pity coming  
over the Cat5...), and I whacked together a fairly simple schema to  
use with Google Maps.  I've also been playing with XMLBeans for  
generating Java code to parse and build XML documents, and this  
turned out to be a pretty good way to get my feet wet.

I've created a new project in my personal subversion repository:
     http://telly.bravo5.org/svn/repos/gmaps/

There's an example document in there
     http://telly.bravo5.org/svn/repos/gmaps/trunk/schema/gmaps_ref.xml
that I'll reference.

The beauty of my little schema (boastful, aren't I?) is that the  
contents of the point nodes are defined to be the same as the  
contents of an XHTML div.  If a point node has any children, the  
entire node can be passed directly to the openInfoWindow() method of  
a GMarker instance, and it displays it properly.  I haven't decided  
if this is a fluke or by design yet, but it *is* what I had in mind  
when I put this together...

I've really just explicitly defined a similar structure to the one  
that Google used in their API documentation, but, as I mentioned  
before, I wanted to be able to generate a valid document from Java,  
and learning XMLBeans was kind of a conduit to this.  I admit it's  
overkill, but that's my middle name. :-)

I (like everyone and their mother, apparently) am working on a way to  
dynamically render points and tracklogs on a Google Map, and this  
schema's going to be the vehicle for that data.  The whole thing's  
coming together pretty nicely, and I'm working on dynamically  
filtering trackpoints based on the zoom level.  A mountain bike ride  
I took recently is comprised of about 500 points for an 8 mile ride;  
it's a very nice track when zoomed in, but you don't need to see all  
of those when you're zoomed out and viewing the entire state...

--
    __   ____
   / /  / __/ Brian Lalor           "If you still have gas, you're  
not lost."
  / _ \/__ \  blalor at bravo5.org             -- Jacques Strappe
/_.__/____/  http://bravo5.org/





More information about the Geowanking mailing list