{"id":1489,"date":"2015-11-10T02:17:23","date_gmt":"2015-11-10T02:17:23","guid":{"rendered":"http:\/\/www.phpmind.com\/blog\/?p=1489"},"modified":"2015-11-10T02:17:23","modified_gmt":"2015-11-10T02:17:23","slug":"cesiumjs-how-can-i-remove-polyline","status":"publish","type":"post","link":"https:\/\/www.phpmind.com\/blog\/2015\/11\/cesiumjs-how-can-i-remove-polyline\/","title":{"rendered":"Cesiumjs &#8211; How can I remove polyline?"},"content":{"rendered":"<p><a href=\"http:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2015\/11\/Cesiumjs-remove-polyline.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2015\/11\/Cesiumjs-remove-polyline.png\" alt=\"Cesiumjs-remove-polyline\" width=\"873\" height=\"575\" class=\"aligncenter size-full wp-image-1490\" srcset=\"https:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2015\/11\/Cesiumjs-remove-polyline.png 873w, https:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2015\/11\/Cesiumjs-remove-polyline-300x198.png 300w, https:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2015\/11\/Cesiumjs-remove-polyline-624x411.png 624w\" sizes=\"auto, (max-width: 873px) 100vw, 873px\" \/><\/a><\/p>\n<pre>\r\nvar viewer = new Cesium.Viewer('cesiumContainer');\r\n\r\nvar redLine = viewer.entities.add({\r\n    name : 'Red line on the surface',\r\n    polyline : {\r\n        positions : Cesium.Cartesian3.fromDegreesArray([-75, 35,\r\n                                                        -125, 35]),\r\n        width : 5,\r\n        material : Cesium.Color.RED\r\n    }\r\n});\r\n\r\nSandcastle.addToolbarButton('Remove', function() {\r\n    viewer.entities.remove(redLine);\r\n});\r\n\r\nSandcastle.addToolbarButton('Remove all', function() {\r\n    viewer.entities.removeAll();\r\n});\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>var viewer = new Cesium.Viewer(&#8216;cesiumContainer&#8217;); var redLine = viewer.entities.add({ name : &#8216;Red line on the surface&#8217;, polyline : { positions : Cesium.Cartesian3.fromDegreesArray([-75, 35, -125, 35]), width : 5, material : Cesium.Color.RED } }); Sandcastle.addToolbarButton(&#8216;Remove&#8217;, function() { viewer.entities.remove(redLine); }); Sandcastle.addToolbarButton(&#8216;Remove all&#8217;, function() { viewer.entities.removeAll(); });<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[53,27],"tags":[],"class_list":["post-1489","post","type-post","status-publish","format-standard","hentry","category-cesiumjs","category-javascript"],"_links":{"self":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/comments?post=1489"}],"version-history":[{"count":1,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1489\/revisions"}],"predecessor-version":[{"id":1491,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1489\/revisions\/1491"}],"wp:attachment":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/media?parent=1489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/categories?post=1489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/tags?post=1489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}