Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

  1. 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 )

  2. how we create line between two cordinates on polymap?

  3. http://webcache.googleusercontent.com/search?q=cache:vVkS6oWCxnsJ:groups.google.com/group/d3-js/browse_thread/thread/ccd1c8a4f8b85855+&cd=3&hl=en&ct=clnk&gl=in

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);





}
share|improve this question
1  
first of all, if u want to get answer, pls increase your 0% accept rate. –  Aragon May 28 '12 at 8:15
    
And How do I do that ? I did try to look around but did not find the place to accept –  user1089553 May 28 '12 at 8:55
    
Please refer to the How do I ask, section of the FAQ, as well as other sections, as these will help you format your questions in a way to invite better answers, and also to give proper credit for a good answer. –  Get Spatial May 28 '12 at 8:59
    
I would add that the one of the questions you referenced here, is one you asked. It basically asks the same as this question. It would be more concise to revise one of these questions with more detail and clarity, and remove the other, to avoid duplicates. –  Get Spatial May 28 '12 at 9:01
1  
you should check out How does accepting an answer work? –  Aragon May 28 '12 at 9:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.