Commit 72cb87167a8a8214c377468d327e36dc5f26c3fb
1 parent
cb212a85
Exists in
master
and in
7 other branches
Adaptações dos códigos para a versão 6 do Mapserver
Showing
2 changed files
with
27 additions
and
5 deletions
Show diff stats
pacotes/kmlmapserver/classes/layerserver.class.php
... | ... | @@ -264,6 +264,18 @@ class LayerServer { |
264 | 264 | */ |
265 | 265 | function process_layer_request(&$layer_name){ |
266 | 266 | error_reporting(0); |
267 | + | |
268 | + $v = "5.0.0"; | |
269 | + $vs = explode(" ",ms_GetVersion()); | |
270 | + $cvs = count($vs); | |
271 | + for ($i=0;$i<$cvs;++$i) | |
272 | + { | |
273 | + if(trim(strtolower($vs[$i])) == "version") | |
274 | + {$v = $vs[$i+1];} | |
275 | + } | |
276 | + $v = explode(".",$v); | |
277 | + $versao = $v[0]; | |
278 | + | |
267 | 279 | $layer = @$this->map_object->getLayerByName($layer_name); |
268 | 280 | if(!$layer) |
269 | 281 | {$layer = $this->map_object->getlayer(0);} |
... | ... | @@ -355,8 +367,12 @@ class LayerServer { |
355 | 367 | for ($j=0; $j < $layer->getNumResults(); $j++) |
356 | 368 | { |
357 | 369 | // get next shape row |
358 | - $result = $layer->getResult($j); | |
359 | - $shape = $layer->getShape($result->tileindex, $result->shapeindex); | |
370 | + if($versao == 6) | |
371 | + {$shape = $layer->getShape($layer->getResult($j));} | |
372 | + else{ | |
373 | + $result = $layer->getResult($j); | |
374 | + $shape = $layer->getFeature($result->shapeindex,$result->tileindex); | |
375 | + } | |
360 | 376 | $this->process_shape($layer, $shape, $class_list, $folder, $namecol); |
361 | 377 | // end for loop |
362 | 378 | } |
... | ... | @@ -372,8 +388,12 @@ class LayerServer { |
372 | 388 | for ($j=0; $j < $n; $j++) |
373 | 389 | { |
374 | 390 | // get next shape row |
375 | - $result = $layer->getResult($j); | |
376 | - $shape = $layer->getShape($result->tileindex, $result->shapeindex); | |
391 | + if($versao == 6) | |
392 | + {$shape = $layer->getShape($layer->getResult($j));} | |
393 | + else{ | |
394 | + $result = $layer->getResult($j); | |
395 | + $shape = $layer->getFeature($result->shapeindex,$result->tileindex); | |
396 | + } | |
377 | 397 | $shape->classindex = $result->classindex; |
378 | 398 | $this->process_shape($layer, $shape, $class_list, $folder, $namecol); |
379 | 399 | } | ... | ... |
pacotes/kmlmapserver/classes/symbolserver.class.php
... | ... | @@ -200,7 +200,9 @@ class SymbolServer { |
200 | 200 | function send_icon(){ |
201 | 201 | header('Content-type:image/png'); |
202 | 202 | // Set transparency (needs imageformat RBGA in the mapfile too) |
203 | - $this->map_object->set('transparent', 'on'); | |
203 | + $o = $this->map_object->outputformat; | |
204 | + $o->set("transparent",MS_ON); | |
205 | + //$this->map_object->set('transparent', 'on'); | |
204 | 206 | $img = $this->map_object->draw(); |
205 | 207 | $this->iconpoint->draw($this->map_object, $this->icon_layer, $img, $this->classindex, ''); |
206 | 208 | $img->saveImage(''); | ... | ... |