{"id":1596,"date":"2016-04-05T02:01:50","date_gmt":"2016-04-05T02:01:50","guid":{"rendered":"http:\/\/www.phpmind.com\/blog\/?p=1596"},"modified":"2016-04-05T02:01:50","modified_gmt":"2016-04-05T02:01:50","slug":"cesium-ajax-to-update-infobox","status":"publish","type":"post","link":"https:\/\/www.phpmind.com\/blog\/2016\/04\/cesium-ajax-to-update-infobox\/","title":{"rendered":"Cesium &#8211; AJAX to update InfoBox ?"},"content":{"rendered":"<pre>\r\n\r\nvar viewer = new Cesium.Viewer('cesiumContainer');\r\nvar scene = viewer.scene;\r\n\r\nvar handlerA = new Cesium.ScreenSpaceEventHandler(scene.canvas);\r\n  handlerA.setInputAction(function(click) {\r\n    var pickedObject = scene.pick(click.position);\r\n    if (Cesium.defined(pickedObject)) {\r\n      $.ajax({\r\n\r\n        type: 'GET',\r\n        url: 'InfoBox.php',\r\n        data: (pickedObject.id.id).val(),\r\n\r\n        success: function(result) {\r\n          pickedObject.id.description = \"The temperatur of \" + result.town + \" is \" + result.temp + \" degrees...\";\r\n        }\r\n      }); \r\n    }\r\n  }, Cesium.ScreenSpaceEventType.LEFT_CLICK);\r\n\r\n<\/pre>\n<p>pickedObject.id is the entity.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>var viewer = new Cesium.Viewer(&#8216;cesiumContainer&#8217;); var scene = viewer.scene; var handlerA = new Cesium.ScreenSpaceEventHandler(scene.canvas); handlerA.setInputAction(function(click) { var pickedObject = scene.pick(click.position); if (Cesium.defined(pickedObject)) { $.ajax({ type: &#8216;GET&#8217;, url: &#8216;InfoBox.php&#8217;, data: (pickedObject.id.id).val(), success: function(result) { pickedObject.id.description = &#8220;The temperatur of &#8221; + result.town + &#8221; is &#8221; + result.temp + &#8221; degrees&#8230;&#8221;; } }); } }, Cesium.ScreenSpaceEventType.LEFT_CLICK); [&hellip;]<\/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":[1],"tags":[],"class_list":["post-1596","post","type-post","status-publish","format-standard","hentry","category-ajax"],"_links":{"self":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1596","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=1596"}],"version-history":[{"count":1,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1596\/revisions"}],"predecessor-version":[{"id":1597,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1596\/revisions\/1597"}],"wp:attachment":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/media?parent=1596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/categories?post=1596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/tags?post=1596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}