I would like to create polyline on the click of the mouse. I have 4 circles 3 with radius 2 (Lets name it as B,C,D) and 1 with radius 8 (Lets name it as A). Now when I click on the circle A, poly line should be made which connects A to B, A to C & A to D.
I have the lat and long of A,B,C,D. Also the polyline from Circle A to B,C,D should be of different width and maybe color.
I have looked into the following suggestions
Polymaps + D3+ Polyline with different width and color (This one is asked by me but could not get the right output, my apologies for duplication, since I really need to get an answer for this ASAP )
But could not get much help, I would appreciate if you can give me some advise or code anything to start in the right direction
Thanks
Mehul
As suggested by your post I have made this js but does not seem to work was wondering if you can have a look at it and let me know the mistake
{// JavaScript Document
var po = org.polymaps;
var svg = n$("#map").add("svg:svg");
var map = po.map()
.container($n(svg))
.center({lat: 33.787, lon: -118.195})
.zoom(9)
.add(po.interact());
map.add(po.image()
.url(po.url("http://{S}tile.cloudmade.com"
+ "/1a1b06b230af4efdbb989ea99e9841af" // http://cloudmade.com/register
+ "/998/256/{Z}/{X}/{Y}.png")
.hosts(["a.", "b.", "c.", ""])));
map.add(po.compass()
.pan("none"));
//map.add(po.geoJson()
var map = po.map();
var layer = po.geoJson();
var featAtoB ={ "type": "Feature",
"geometry": {"type": "Point", "coordinates": [[-118.195, 33.768],[-117.914, 33.768]]},
"properties": {"prop0": "value0"}
},
{ "type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[-118.195, 33.768],[-117.914, 33.768]
]
},
"properties": {
"prop0": "value0",
"prop1": {"this": "that"}
}
};
layer.features([featAtoB]);
map.add(layer);
}
0% accept rate. – Aragon May 28 '12 at 8:15