Commit ed464a2e6854c890994c7da3e0be6c9ac6a41c9e
1 parent
f3e27dd1
Exists in
master
and in
7 other branches
Correção na conversão gvp->mapfile nos casos onde existe a classe com.iver.cit.g…
…vsig.fmap.rendering.ZSort
Showing
1 changed file
with
29 additions
and
19 deletions
Show diff stats
pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php
@@ -116,6 +116,7 @@ class gvsig2mapfile{ | @@ -116,6 +116,7 @@ class gvsig2mapfile{ | ||
116 | $valores = (string) $this->getValue($path."/tag:xml-tag","values"); | 116 | $valores = (string) $this->getValue($path."/tag:xml-tag","values"); |
117 | $tipocoluna = (string) $this->getValue($path."/tag:xml-tag","fieldTypes"); | 117 | $tipocoluna = (string) $this->getValue($path."/tag:xml-tag","fieldTypes"); |
118 | $nomes = (string) $this->getValue($path."/tag:xml-tag","keys"); | 118 | $nomes = (string) $this->getValue($path."/tag:xml-tag","keys"); |
119 | + | ||
119 | $classes = $this->VectorialUniqueValueLegend($result,$path1,$coluna,$tipocoluna,$valores,$nomes); | 120 | $classes = $this->VectorialUniqueValueLegend($result,$path1,$coluna,$tipocoluna,$valores,$nomes); |
120 | } | 121 | } |
121 | 122 | ||
@@ -123,6 +124,7 @@ class gvsig2mapfile{ | @@ -123,6 +124,7 @@ class gvsig2mapfile{ | ||
123 | $result = $this->xml->xpath($path1); | 124 | $result = $this->xml->xpath($path1); |
124 | if($result != FALSE) | 125 | if($result != FALSE) |
125 | {$classes = $this->SingleSymbolLegend($result,$path1);} | 126 | {$classes = $this->SingleSymbolLegend($result,$path1);} |
127 | + | ||
126 | // | 128 | // |
127 | //obtem a conexão | 129 | //obtem a conexão |
128 | //a senha não pode ser obtida, então, é usado o mesmo nome de usuário em seu lugar. No i3Geo deve-se prever isso na variável de substituição de string. | 130 | //a senha não pode ser obtida, então, é usado o mesmo nome de usuário em seu lugar. No i3Geo deve-se prever isso na variável de substituição de string. |
@@ -167,6 +169,7 @@ class gvsig2mapfile{ | @@ -167,6 +169,7 @@ class gvsig2mapfile{ | ||
167 | $nomes = explode(",",$nomes); | 169 | $nomes = explode(",",$nomes); |
168 | $classes = array(); | 170 | $classes = array(); |
169 | $c = 0; | 171 | $c = 0; |
172 | + | ||
170 | while(list( , $node) = each($result)) { | 173 | while(list( , $node) = each($result)) { |
171 | $classe = array(); | 174 | $classe = array(); |
172 | if($tipocoluna == 12) | 175 | if($tipocoluna == 12) |
@@ -194,35 +197,40 @@ class gvsig2mapfile{ | @@ -194,35 +197,40 @@ class gvsig2mapfile{ | ||
194 | {$classes[] = $classe;} | 197 | {$classes[] = $classe;} |
195 | $c = $c + 1; | 198 | $c = $c + 1; |
196 | } | 199 | } |
200 | + | ||
201 | + //com.iver.cit.gvsig.fmap.rendering.ZSort | ||
197 | return $classes; | 202 | return $classes; |
198 | } | 203 | } |
199 | function SingleSymbolLegend($result,$path){ | 204 | function SingleSymbolLegend($result,$path){ |
200 | $classes = array(); | 205 | $classes = array(); |
201 | $c = 0; | 206 | $c = 0; |
202 | - //var_dump($result);exit; | 207 | + |
203 | while(list( , $node) = each($result)) { | 208 | while(list( , $node) = each($result)) { |
204 | $classe = array(); | 209 | $classe = array(); |
205 | $classe["className"] = (string) $this->getValue($path,"className",$c); | 210 | $classe["className"] = (string) $this->getValue($path,"className",$c); |
206 | - $classe["desc"] = (string) $this->getValue($path,"desc",$c); | ||
207 | - $classe["color"] = (string) $this->getValue($path,"color",$c); | ||
208 | - $classe["rotation"] = (string) $this->getValue($path,"rotation",$c); | ||
209 | - $classe["offsetX"] = (string) $this->getValue($path,"offsetX",$c); | ||
210 | - $classe["offsetY"] = (string) $this->getValue($path,"offsetY",$c); | ||
211 | - $classe["size"] = (string) $this->getValue($path,"size",$c); | ||
212 | - $classe["markerStyle"] = (string) $this->getValue($path,"markerStyle",$c); | ||
213 | - $classe["hasFill"] = (string) $this->getValue($path,"hasFill",$c); | ||
214 | - $classe["hasOutline"] = (string) $this->getValue($path,"hasOutline",$c); | ||
215 | - $classe["exp"] = false; | ||
216 | - $classe["nome"] = " "; | ||
217 | - if($classe["hasOutline"] == "true"){ | ||
218 | - $classe["outline"] = (string) $this->getValue($path."/tag:xml-tag","color"); | ||
219 | - } | ||
220 | - else{ | ||
221 | - $classe["outline"] = (string) $this->getValue($path,"color",$c); | 211 | + if($classe["className"] != "com.iver.cit.gvsig.fmap.rendering.ZSort"){ |
212 | + $classe["desc"] = (string) $this->getValue($path,"desc",$c); | ||
213 | + $classe["color"] = (string) $this->getValue($path,"color",$c); | ||
214 | + $classe["rotation"] = (string) $this->getValue($path,"rotation",$c); | ||
215 | + $classe["offsetX"] = (string) $this->getValue($path,"offsetX",$c); | ||
216 | + $classe["offsetY"] = (string) $this->getValue($path,"offsetY",$c); | ||
217 | + $classe["size"] = (string) $this->getValue($path,"size",$c); | ||
218 | + $classe["markerStyle"] = (string) $this->getValue($path,"markerStyle",$c); | ||
219 | + $classe["hasFill"] = (string) $this->getValue($path,"hasFill",$c); | ||
220 | + $classe["hasOutline"] = (string) $this->getValue($path,"hasOutline",$c); | ||
221 | + $classe["exp"] = false; | ||
222 | + $classe["nome"] = " "; | ||
223 | + if($classe["hasOutline"] == "true"){ | ||
224 | + $classe["outline"] = (string) $this->getValue($path."/tag:xml-tag","color"); | ||
225 | + } | ||
226 | + else{ | ||
227 | + $classe["outline"] = (string) $this->getValue($path,"color",$c); | ||
228 | + } | ||
229 | + $classes[] = $classe; | ||
230 | + $c = $c + 1; | ||
222 | } | 231 | } |
223 | - $classes[] = $classe; | ||
224 | - $c = $c + 1; | ||
225 | } | 232 | } |
233 | + | ||
226 | return $classes; | 234 | return $classes; |
227 | } | 235 | } |
228 | function getValue($path,$key,$i=0){ | 236 | function getValue($path,$key,$i=0){ |
@@ -266,6 +274,7 @@ class gvsig2mapfile{ | @@ -266,6 +274,7 @@ class gvsig2mapfile{ | ||
266 | {$oLayer->set("type",0);} | 274 | {$oLayer->set("type",0);} |
267 | if($tipo == "com.iver.cit.gvsig.fmap.core.symbols.SimpleFillSymbol") | 275 | if($tipo == "com.iver.cit.gvsig.fmap.core.symbols.SimpleFillSymbol") |
268 | {$oLayer->set("type",2);} | 276 | {$oLayer->set("type",2);} |
277 | + | ||
269 | foreach($dataLayer["legenda"]["classes"] as $data){ | 278 | foreach($dataLayer["legenda"]["classes"] as $data){ |
270 | //var_dump($data); | 279 | //var_dump($data); |
271 | $classe = ms_newClassObj($oLayer); | 280 | $classe = ms_newClassObj($oLayer); |
@@ -289,6 +298,7 @@ class gvsig2mapfile{ | @@ -289,6 +298,7 @@ class gvsig2mapfile{ | ||
289 | if($data["exp"] != false) | 298 | if($data["exp"] != false) |
290 | {$classe->setExpression($data["exp"]);} | 299 | {$classe->setExpression($data["exp"]);} |
291 | } | 300 | } |
301 | + | ||
292 | return $oLayer; | 302 | return $oLayer; |
293 | } | 303 | } |
294 | function findAttribute($object, $attribute) { | 304 | function findAttribute($object, $attribute) { |