开发者

Creating polylines using javascript

i'm a beginner with jscripts, and i've been working with the ArcGIS API for JavaScript, in creating an elementary map. In fact,i already have my own map, and i found a script (and did some work on it) to create/generate couple of p开发者_运维问答oints on the map. But i have NO IDEA how to create a line(polyline) between the points that are being generated at my map. Can somebody help me about this?? HOW COULD I INTERCONNECT THESE TWO POINTS,USING JScripts? i think that today i googled 'polylines' more than all the people of the world together.. As I said before,i am a begginer in scripting,but what i've figured out is that the polylines are generated from arrays of the point coordinates!!?? Any help would be greatly appreciated.

regards,doni


You can use the following

var points= [new GLatLng(x,y),new GLatLng(x1,y1)];
var polyline = new GPolyline(points, "#0000ff", 5);
map.addOverlay(polyline);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜