|
| 1 | +/* |
| 2 | + Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + or more contributor license agreements. See the NOTICE file |
| 4 | + distributed with this work for additional information |
| 5 | + regarding copyright ownership. The ASF licenses this file |
| 6 | + to you under the Apache License, Version 2.0 (the |
| 7 | + "License"); you may not use this file except in compliance |
| 8 | + with the License. You may obtain a copy of the License at |
| 9 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + Unless required by applicable law or agreed to in writing, |
| 11 | + software distributed under the License is distributed on an |
| 12 | + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 13 | + KIND, either express or implied. See the License for the |
| 14 | + specific language governing permissions and limitations |
| 15 | + under the License. |
| 16 | +*/ |
| 17 | + |
| 18 | +package model |
| 19 | + |
| 20 | +//KML struct |
| 21 | +type KML struct { |
| 22 | + Doc Document `xml:"Document"` |
| 23 | + Placemarks []PlaceMark `xml:"Placemark"` |
| 24 | + F Folder `xml:"Folder"` |
| 25 | + NetLink NetworkLink `xml:"NetworkLink"` |
| 26 | +} |
| 27 | + |
| 28 | +//Document struct |
| 29 | +type Document struct { |
| 30 | + Name string `xml:"name"` |
| 31 | + StyleM StyleMap `xml:"StyleMap"` |
| 32 | + Style []Style `xml:"Style"` |
| 33 | + F []Folder `xml:"Folder"` |
| 34 | + Lookat LookAt `xml:"LookAt"` |
| 35 | + NetLink NetworkLink `xml:"NetworkLink"` |
| 36 | +} |
| 37 | + |
| 38 | +//NetworkLink struct |
| 39 | +type NetworkLink struct { |
| 40 | + Name string `xml:"name"` |
| 41 | + Visibility int `xml:"visibility"` |
| 42 | + Open int `xml:"open"` |
| 43 | + Lookat LookAt `xml:"LookAt"` |
| 44 | + FlyToView string `xml:"flyToView"` |
| 45 | + URLInfo URL `xml:"Url"` |
| 46 | +} |
| 47 | + |
| 48 | +//LookAt struct |
| 49 | +type LookAt struct { |
| 50 | + Longitude string `xml:"longitude"` |
| 51 | + Latitude string `xml:"latitude"` |
| 52 | + Altitude string `xml:"altitude"` |
| 53 | + Range string `xml:"range"` |
| 54 | + Tilt string `xml:"tilt"` |
| 55 | + Heading string `xml:"heading"` |
| 56 | + AltitudeMode string `xml:"altitudeMode"` |
| 57 | +} |
| 58 | + |
| 59 | +//URL struct |
| 60 | +type URL struct { |
| 61 | + Href string `xml:"href"` |
| 62 | + RefreshInterval string `xml:"refreshInterval"` |
| 63 | + ViewRefreshMode string `xml:"viewRefreshMode"` |
| 64 | + ViewRefreshTime string `xml:"viewRefreshTime"` |
| 65 | + ViewBoundScale string `xml:"viewBoundScale"` |
| 66 | +} |
| 67 | + |
| 68 | +//StyleMap struct |
| 69 | +type StyleMap struct { |
| 70 | + Pairs []Pair `xml:"Pair"` |
| 71 | +} |
| 72 | + |
| 73 | +//Pair struct |
| 74 | +type Pair struct { |
| 75 | + Key string `xml:"key"` |
| 76 | + StyleURL string `xml:"styleUrl"` |
| 77 | +} |
| 78 | + |
| 79 | +//Style struct |
| 80 | +type Style struct { |
| 81 | + IconS IconStyle `xml:"IconStyle"` |
| 82 | + LineS LineStyle `xml:"LineStyle"` |
| 83 | + ListS ListStyle `xml:"ListStyle"` |
| 84 | +} |
| 85 | + |
| 86 | +//IconStyle struct customizes the pinpoints |
| 87 | +type IconStyle struct { |
| 88 | + Scale string `xml:"scale"` |
| 89 | + Ico Icon `xml:"Icon"` |
| 90 | + HS HotSpot `xml:"hotSpot"` |
| 91 | +} |
| 92 | + |
| 93 | +//Icon struct contains the link to the icon |
| 94 | +type Icon struct { |
| 95 | + Href string `xml:"href"` |
| 96 | +} |
| 97 | + |
| 98 | +//HotSpot struct |
| 99 | +type HotSpot struct { |
| 100 | + X string `xml:"x,attr"` |
| 101 | + Y string `xml:"y,attr"` |
| 102 | + Xunits string `xml:"xunits,attr"` |
| 103 | + Yunits string `xml:"yunits,attr"` |
| 104 | +} |
| 105 | + |
| 106 | +//LineStyle struct styles the strokes that join two or more geographical points |
| 107 | +type LineStyle struct { |
| 108 | + Color string `xml:"color"` |
| 109 | + Width string `xml:"width"` |
| 110 | +} |
| 111 | + |
| 112 | +//ListStyle struct |
| 113 | +type ListStyle struct { |
| 114 | + ListItemType string `xml:"listItemType"` |
| 115 | + ItemIco ItemIcon `xml:"ItemIcon"` |
| 116 | + BgColor string `xml:"bgColor"` |
| 117 | + MaxSnippetLines string `xml:"maxSnippetLines"` |
| 118 | +} |
| 119 | + |
| 120 | +//ItemIcon struct |
| 121 | +type ItemIcon struct { |
| 122 | + State string `xml:"state"` |
| 123 | + Href string `xml:"href"` |
| 124 | +} |
| 125 | + |
| 126 | +//Folder struct |
| 127 | +type Folder struct { |
| 128 | + Name string `xml:"name"` |
| 129 | + Visibility string `xml:"description"` |
| 130 | + Open int `xml:"open"` |
| 131 | + F []Folder `xml:"Folder"` |
| 132 | + Lookat LookAt `xml:"LookAt"` |
| 133 | + Placemarks []PlaceMark `xml:"Placemark"` |
| 134 | + PhotoOverlayList []PhotoOverlay `xml:"PhotoOverlay"` |
| 135 | +} |
| 136 | + |
| 137 | +//PlaceMark struct pinpoints a location through reference to the Earth’s surface |
| 138 | +type PlaceMark struct { |
| 139 | + Name string `xml:"name"` |
| 140 | + Description string `xml:"description"` |
| 141 | + P Point `xml:"Point"` |
| 142 | + StyleURL string `xml:"styleUrl"` |
| 143 | + LineS LineString `xml:"LineString"` |
| 144 | +} |
| 145 | + |
| 146 | +//LineString struct identifies at least two points to connect |
| 147 | +type LineString struct { |
| 148 | + Tssellate string `xml:"tessellate"` |
| 149 | + AltitudeMode string `xml:"altitudeMode"` |
| 150 | + Coordinates string `xml:"coordinates"` |
| 151 | +} |
| 152 | + |
| 153 | +//PhotoOverlay struct |
| 154 | +type PhotoOverlay struct { |
| 155 | + Name string `xml:"name"` |
| 156 | + Cam Camera `xml:"Camera"` |
| 157 | + Style Style `xml:"Style"` |
| 158 | + Ico Icon `xml:"Icon"` |
| 159 | + Rotation string `xml:"rotation"` |
| 160 | + VVolume ViewVolume `xml:"ViewVolume"` |
| 161 | + P Point `xml:"Point"` |
| 162 | +} |
| 163 | + |
| 164 | +//Camera struct |
| 165 | +type Camera struct { |
| 166 | + Longitude string `xml:"longitude"` |
| 167 | + Latitude string `xml:"latitude"` |
| 168 | + Altitude string `xml:"altitude"` |
| 169 | + Heading string `xml:"heading"` |
| 170 | + Tilt string `xml:"tilt"` |
| 171 | + Rll string `xml:"roll"` |
| 172 | + AltitudeMode string `xml:"altitudeMode"` |
| 173 | +} |
| 174 | + |
| 175 | +//ViewVolume struct |
| 176 | +type ViewVolume struct { |
| 177 | + LeftFov string `xml:"leftFov"` |
| 178 | + RightFov string `xml:"rightFov"` |
| 179 | + BottomFov string `xml:"bottomFov"` |
| 180 | + TopFov string `xml:"topFov"` |
| 181 | + Near string `xml:"near"` |
| 182 | +} |
| 183 | + |
| 184 | +//Point struct contains geographical information |
| 185 | +type Point struct { |
| 186 | + AltitudeMode string `xml:"altitudeMode"` |
| 187 | + Coordinates string `xml:"coordinates"` |
| 188 | +} |
0 commit comments