{"id":1479,"date":"2015-10-25T03:18:46","date_gmt":"2015-10-25T03:18:46","guid":{"rendered":"http:\/\/www.phpmind.com\/blog\/?p=1479"},"modified":"2015-10-25T03:20:05","modified_gmt":"2015-10-25T03:20:05","slug":"cesiumjs-how-to-add-global-event-for-specific-entities","status":"publish","type":"post","link":"https:\/\/www.phpmind.com\/blog\/2015\/10\/cesiumjs-how-to-add-global-event-for-specific-entities\/","title":{"rendered":"Cesiumjs &#8211; How to add global event for specific entities?"},"content":{"rendered":"<p><a href=\"http:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2015\/10\/phpmind-cesiumjs-event-for-specific-entities.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2015\/10\/phpmind-cesiumjs-event-for-specific-entities.png\" alt=\"phpmind-cesiumjs-event-for-specific-entities\" width=\"629\" height=\"506\" class=\"aligncenter size-full wp-image-1480\" srcset=\"https:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2015\/10\/phpmind-cesiumjs-event-for-specific-entities.png 629w, https:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2015\/10\/phpmind-cesiumjs-event-for-specific-entities-300x241.png 300w, https:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2015\/10\/phpmind-cesiumjs-event-for-specific-entities-624x502.png 624w\" sizes=\"auto, (max-width: 629px) 100vw, 629px\" \/><\/a><\/p>\n<pre>\r\n var viewer = new Cesium.Viewer('cesiumContainer');\r\n\r\n    viewer.dataSources.add(Cesium.CzmlDataSource.load('..\/..\/SampleData\/simple.czml'));\r\n\r\n    Cesium.knockout.getObservable(viewer, '_selectedEntity').subscribe(function(entity) {\r\n        if (!Cesium.defined(entity)) {\r\n            console.log('De-selected entity.');\r\n        } else {\r\n            console.log('Selected entity ' + (entity.name || entity.id));\r\n        }\r\n    });\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>var viewer = new Cesium.Viewer(&#8216;cesiumContainer&#8217;); viewer.dataSources.add(Cesium.CzmlDataSource.load(&#8216;..\/..\/SampleData\/simple.czml&#8217;)); Cesium.knockout.getObservable(viewer, &#8216;_selectedEntity&#8217;).subscribe(function(entity) { if (!Cesium.defined(entity)) { console.log(&#8216;De-selected entity.&#8217;); } else { console.log(&#8216;Selected entity &#8216; + (entity.name || entity.id)); } });<\/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-1479","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\/1479","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=1479"}],"version-history":[{"count":1,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1479\/revisions"}],"predecessor-version":[{"id":1481,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1479\/revisions\/1481"}],"wp:attachment":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/media?parent=1479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/categories?post=1479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/tags?post=1479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}