What is Gaml? alpha: ie. barely works :)

« back to SilverlightEarth

'Geographic' Application Markup Language *

* NOT to be confused with the generalized analytical markup language - hope they don't mind sharing it.

Gaml is simply "Xaml with co-ordinates", here's a simple example sample.gaml, which can be viewed in SilverlightEarth simply by entering the filename in the Search box



The result of "searching" for a gaml file is the Xaml elements being rendered according to the coordinates and zoom level specified.



The custom attributes that make Xaml → Gaml are:

Attribute Example
xmlns:g xmlns:g="http://silverlightearth.com/2007/gaml"
g:Latitude g:Latitude="-33.90362040123444"
g:Longitude g:Longitude="151.2510593125"
g:Zoom g:Zoom="13"

Although the sample.gaml file can be viewed with just the filename, any real example requires the complete URL to the file (eg. http://www.silverlightearth.com/gaml/samples/flag_nsw.gaml or http://www.silverlightearth.com/gaml/samples/flag_canada.gaml)

Cross site scripting vunerability(?)

Accepting Xaml from external locations obviously has its pitfalls - although I'm sure yet exactly what security implications there are, versus people just presenting misleading information. Ultimately for Gaml to be useful, you need to be able to trigger animations and links, but in a way that is secure and doesn't allow user-supplied code to execute... still figuring that bit out (but likely to require additional namespace elements, and a 'library' of SilverlightEarth functions for common tasks).

Other examples

http://www.silverlightearth.com/gaml/Samples/flickr_nyc1.gaml


http://www.silverlightearth.com/gaml/Samples/flag_nsw.gaml


http://www.silverlightearth.com/gaml/Samples/flag_canada.gaml

Thanks

The Xaml maps in these samples are part of the OpenClipArt collection of SVG files, converted to Xaml by Daniel Cazzulino using the ReaderSvg SVG to Xaml Converter. (although they required changes to work in Silverlight - unsure whether it's due to WPF and Silverlight Xaml, or whether the Svg converter doesn't quite get all the transformations right...)