File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,6 +145,22 @@ function buildScreenOverlay($screenOverlayXMLObject) {
145145
146146 processOverlay ($ screenOverlay , $ screenOverlayXMLObject );
147147
148+ $ screenOverlayContent = $ screenOverlayXMLObject ->children ();
149+
150+ foreach ($ screenOverlayContent as $ key => $ value ) {
151+ if ($ key == 'rotation ' ) {
152+ $ screenOverlay ->setRotation ((string )$ value );
153+ } elseif ($ key == 'overlayXY ' ) {
154+ $ screenOverlay ->setOverlayXY (buildVec2Type ($ value ));
155+ } elseif ($ key == 'screenXY ' ) {
156+ $ screenOverlay ->setScreenXY (buildVec2Type ($ value ));
157+ } elseif ($ key == 'rotationXY ' ) {
158+ $ screenOverlay ->setRotationXY (buildVec2Type ($ value ));
159+ } elseif ($ key == 'size ' ) {
160+ $ screenOverlay ->setSize (buildVec2Type ($ value ));
161+ }
162+ }
163+
148164 return $ screenOverlay ;
149165 }
150166
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ public function __toString() {
6969 $ output = array ();
7070
7171 if (isset ($ this ->name )) {
72- $ output [] = sprintf ("\t<name>%s</name> " , $ this ->name );
72+ $ output [] = sprintf ("\t<name>%s</name> " , htmlentities ( $ this ->name ) );
7373 }
7474
7575 if (isset ($ this ->visibility )) {
@@ -105,7 +105,7 @@ public function __toString() {
105105 }
106106
107107 if (isset ($ this ->description )) {
108- $ output [] = sprintf ("\t<description>%s </description> " , $ this ->description );
108+ $ output [] = sprintf ("\t<description><![CDATA[ \n %s \n ]]> </description> " , $ this ->description );
109109 }
110110
111111 if (isset ($ this ->abstractView )) {
Original file line number Diff line number Diff line change @@ -23,8 +23,23 @@ public function __toString() {
2323 $ output [] = $ parent_string ;
2424
2525 if (isset ($ this ->rotation )) {
26- $ output [] = sprintf ("\t<rotation>%f</rotation> " , $ this ->rotation );
27-
26+ $ output [] = sprintf ("\t<rotation>%s</rotation> " , $ this ->rotation );
27+ }
28+
29+ if (isset ($ this ->overlayXY )) {
30+ $ output [] = sprintf ("\t<overlayXY %s /> " , $ this ->overlayXY );
31+ }
32+
33+ if (isset ($ this ->screenXY )) {
34+ $ output [] = sprintf ("\t<screenXY %s /> " , $ this ->screenXY );
35+ }
36+
37+ if (isset ($ this ->rotationXY )) {
38+ $ output [] = sprintf ("\t<rotationXY %s /> " , $ this ->rotationXY );
39+ }
40+
41+ if (isset ($ this ->size )) {
42+ $ output [] = sprintf ("\t<size %s /> " , $ this ->size );
2843 }
2944
3045 $ output [] = "</ScreenOverlay> " ;
Original file line number Diff line number Diff line change 4343/*
4444 * Objects
4545 */
46- include_once ( ' libKML/KMLBuilder.php ' );
46+
4747include_once ('libKML/KMLObject.php ' );
4848include_once ('libKML/Icon.php ' );
4949include_once ('libKML/features/AltitudeMode.php ' );
5858include_once ('libKML/features/overlays/GroundOverlay.php ' );
5959include_once ('libKML/features/overlays/ScreenOverlay.php ' );
6060include_once ('libKML/field_types/Coordinates.php ' );
61+ include_once ('libKML/field_types/ItemIconState.php ' );
6162include_once ('libKML/field_types/RefreshMode.php ' );
6263include_once ('libKML/field_types/ColorMode.php ' );
6364include_once ('libKML/field_types/ListItemType.php ' );
8485include_once ('libKML/views/AbstractView.php ' );
8586include_once ('libKML/views/Camera.php ' );
8687include_once ('libKML/views/LookAt.php ' );
88+ include_once ('libKML/KMLBuilder.php ' );
8789
8890
8991function parseKML ($ data ) {
Original file line number Diff line number Diff line change @@ -345,13 +345,6 @@ function init_original_kml() {
345345 </div>
346346 </div>
347347
348- <div id="generatedJSON" class="block">
349- <h2>All features</h2>
350- <div class="content">
351- <pre><?php print_r ($ kml ->getAllFeatures ()); ?> </pre>
352- </div>
353- </div>
354-
355348 <?php endif ; ?>
356349
357350</body>
You can’t perform that action at this time.
0 commit comments