Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on d3 and polymaps, I plot map and create circle on the given latitude and longitude which retrieves from the JSON file but now I want to connect those circles with line. I tried to do it with SVG but I am unable to find the accurate result.

share|improve this question

Hi I did write this code but only the points are been plotted

{
  // 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"));



//this is for creating dots on the map(see in black color) work well
 map.add(po.geoJson()
.features([{geometry: {coordinates: [[-118.195, 33.768],[-117.914, 33.768]], type: "MultiPoint"}}])
 );

//this is for creating line on the map but not working
 map.add(po.geoJson()
.features([{geometry: {coordinates: [[-118.195, 33.768],[-117.914, 33.768]], type:  "LineString"},properties: {"stroke": "red","stroke-width": .2,"fill-opacity":.6}}]));







}
share|improve this answer
    
I found it, the best way to do this to have D3+polymaps together. As there are few limitation to polymaps. – user1089553 May 29 '12 at 11:05

try this:

var map = po.map();
var layer = po.geoJson();
var featAtoB = {type: "Feature", geometry: {type: "LineString", 
               coordinates: [[14,50], [6,49]]},
               properties: {prop0: "value0",prop1: 0.0}};
layer.features([featAtoB]);

map.add(layer);

i hope it helps you...

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.