how can i write géographic line ?

642
5
06-29-2014 11:46 PM
thomasrenaud
New Contributor
Hi everybody,

As i just begin in the fabulous world of SIG, I have some problems to perform some tasks on my map. After working on points (it works XD) i want to draw and display some lines. How can i do it ? Should i use SVG ? Because just here (https://developers.arcgis.com/javascript/jssamples/graphics_svg_path.html)  i see we can use SVG to create some awesome Symbol but i don't find how to create a line ?

Please, if you have a tuto o an idea, can you help me ?

Thank you for you help and have a nice day,

Sincerely,

Enoa
0 Kudos
5 Replies
thomasrenaud
New Contributor
Shame on me ! O_o 
I had to read more before to ask my questions.

=> SimpleLinesSymbol()

Thanks
0 Kudos
thomasrenaud
New Contributor
Hi,

I try this thing :

                                          var myLine ={geometry:{"paths":[[[4.0264,48.09885],[0.223,46.085]]],
                    "spatialReference":{"wkid":4326}},
                    "symbol":{"color":[0,0,0,255],"width":1,"type":"esriSLS","style":"esriSLSSolid"}};
                     var graphic= new Graphic(myLine);
             

Up to now, it seems to be Ok, but when I add  :

           map.graphics.add(graphic);


The model doesn't work !

Do you know what is the problem ?

Thanks !
0 Kudos
thomasrenaud
New Contributor
Anyone can help me   
:eek:
0 Kudos
thomasrenaud
New Contributor
hi,

I find a solution :
                var countryLayer = new GraphicsLayer();
    

             
             var myLine ={geometry:{"paths":[[[4.0264,48.09885],[0.223,46.085]]],
        "spatialReference":{"wkid":4326}},
        "symbol":{"color":[0,0,0,255],"width":1,"type":"esriSLS","style":"esriSLSSolid"}};
    
             var gra= new Graphic(myLine);

    
          
    countryLayer.add(gra);
    map.addLayer(countryLayer);


by 🙂
0 Kudos
thomasrenaud
New Contributor
Hi everybody,

As i just begin in the fabulous world of SIG, I have some problems to perform some tasks on my map. After working on points (it works XD) i want to draw and display some lines. How can i do it ? Should i use SVG ? Because just here (https://developers.arcgis.com/javascript/jssamples/graphics_svg_path.html)  i see we can use SVG to create some awesome Symbol but i don't find how to create a line ?

Please, if you have a tuto o an id
ea, can you help me ?

Thank you for you help and have a nice day,

Sincerely,

Enoa
0 Kudos