Some years ago SVG was considered as the next generation of rich media and animation in the internet, as a sort of Flash killer. Nothing happened. Flash technology enhanced and is still widely spread. SVG enhanced too and even went mobile but it’s still a good kept secret.
Now, ESRI & Yahoo! are implementing their webmapping services based on Flash technology. Last week Google silently enabled SVG in their latest API update (API v2.37) for Google Local.
Honestly, it’s quite a time since I did my last Flash development but back then (it was version 5 I guess) I never would have choosen Flash as a tool to be used in a webmapping application. Actually the decision for a vector graphics based webmapping application was then in favour of SVG. Flash’s object handling and ActionScript was too unfunctional for my purpose: I wanted to load geographic objects on demand (e.g. on changing view extents) out of a PostgreSQL/PostGIS database and map them in a web browser, without continuously reloading the whole map of course. SVG was the easiest way to go. As a XML based vector graphic format it allows you to edit, put attributes and styles as you want to every single object within your map. On the other hand vector graphics as SVG required more potential clients compared to raster pictures delievered by mapservers. All objects were handled – requesting & rendering – on the client side (JavaScript was used to access and parse XML, something like “pre AJAX”, to name a buzzword) while the user was interacting with the map. However, after this work I became a big fan of SVG, especially when it comes to webmapping. If there wasn’t this plugin-dependency, which resulted in every single discussion to be the main showstopper for SVG. With native SVG support in a popular browser like Firefox hopefully things start to change.
Back to Google Local: in SVG compatible browsers (such as Firefox 1.5) one can now use SVG rather than PNGs to draw polylines if following parameters are set:
_mSvgEnabled = true/false … to enable/disable SVG in SVG compatible browsers
_mSvgForced = true/false … to force the use of SVG in every browser (even if not capable of displaying SVG correctly) or limit SVG to compatible browsers.
If SVG is not “forced” Internet Explorer 5.5+ will still render polylines with VML (something like a rudimentary SVG…).
This simple comparsion gives an idea what can be done at what perfomance with SVG.
“It draws a random polyline with 100 segments. You can change the
number. There are “Redraw with SVG” and “Redraw without svg” buttons.”
SVG is a well elaborated standard. Maybe Google Local is the push that this technology needs.
Another interesting point on the Flash vs. SVG discussion is the take-over of Macromedia by Adobe. Now we have both technologies under one umbrella. Why not merging them together? Or at least bundle them to one single plugin. Since XML support is already built into Flash, why not extend it to SVG?