Re: svg for world map

Hi, David-

I would do (and have done) the same thing for simple element-driven 
interactivity, where the only concern is getting the name of a state or 
country, which you can get from shape hit detection (e.g. on mouseover 
or focus, get the element title, or id for correlation to a lookup 
table). This is the same as the use case PDR mentioned, with election 
maps. You don't need anything fancy for that; I'm not sure I'd even 
bother with Raphaël for that (except for older browsers).

My impression was that Vicky wanted to cope with proper coordinates, 
which with maps, means you have to deal with at least one geographic 
projection. That means that you not only have to do the projection math, 
but you have to have a map that already has a consistent projection. The 
core of d3.js, and that community, have made that much easier, including 
providing a bunch of ready-made world maps. I learned the basics of 
d3.js and how to do a geo-projection map in a weekend; it's actually got 
a nice layered architecture with SVG itself, less abstraction than with 
Raphaël.

Vicky might have meant simple shape-based interaction, rather than 
latitude/longitude, in which case I agree with your suggestion of 
simplicity.

Regards-
-Doug

On 7/17/13 10:21 PM, David Dailey wrote:
> A couple of years ago, as an experiment for my classes, I allocated
> about six hours to a project that involved taking a public
> domain/freely licensed (public domain is so much nicer than freely
> licensed since the damn licenses are a real nuisance at times when
> one is into cherry picking the good stuff) SVG map of the US
> (Wikimedia commons had a pretty one with the 50 states all nicely
> drawn to elementary school jig saw puzzle precision). sprinkling
> JavaScript-pixie-dust over it to color the stuff and assign event
> handlers, and then hooking it up to a multivariate US census data
> spigot that shaded the map on any of some 90 user-selected variables.
> Some of my cartography friends pointed out that it wasn't a great
> work of cartographic elegance, but heck, the six hours spent bringing
> it from conception to completion, and ready for classroom
> presentation was far less than the time the average person takes to
> orient to the use of D3, Raphael or JQuery. All those things are
> lovely, but sometimes writing 143 characters of hybrid code in a
> metalanguage to avoid writing 36 characters of SVG seems a bit odd to
> me. But then, my perspective on such matters is often askew.
>
> In short, another approach, if you're comfortable with SVG and
> JavaScript is to roll your own. Some might call you a hippy, though,
> and in today's political climate that is a moniker you might want to
> avoid.
>
> Cheers David
>
> -----Original Message----- From: Doug Schepers
> [mailto:schepers@w3.org] Sent: Wednesday, July 17, 2013 5:22 PM To:
> vicky b Cc: www-svg@w3.org Subject: Re: svg for world map
>
> Hi, Vicky-
>
> I suggest you look at d3.js [1]. There are various tutorials out
> there for working with maps and coordinates [2][3].
>
> [1] https://github.com/mbostock/d3/wiki/Gallery [2]
> http://www.d3noob.org/2013/03/a-simple-d3js-map-explained.html [3]
> http://www.schneidy.com/Tutorials/MapsTutorial.html
>
> Regards- -Doug
>
> On 7/17/13 9:31 AM, vicky b wrote:
>> HI All,
>>
>> I want to develop a world map using svg and allow user to select
>> de select countries.
>>
>> can anyone give   coordinates for world map?
>>
>> also how to handle event on svg can anyone point me to  good
>> tutorial on this
>>
>> -- /*Thanks & Regards Vickyb*
>>
>> /
>
>
>
>
>
>
>

Received on Thursday, 18 July 2013 12:41:50 UTC