Commit bb718ebd3d4472f52e4db0420a70899f7ba1f8b8
1 parent
b203e564
Exists in
master
and in
7 other branches
Edição do serviço kml para geração de imagens ao invés de vetores
Showing
2 changed files
with
35 additions
and
0 deletions
Show diff stats
pacotes/kmlmapserver/classes/layerserver.class.php
| ... | ... | @@ -831,7 +831,40 @@ class LayerServer { |
| 831 | 831 | if(!file_exists($this->map) && is_readable($this->map)){ |
| 832 | 832 | $this->set_error('Cannot read mapfile '. $this->map); |
| 833 | 833 | } else { |
| 834 | + $maptemp = ms_newMapObj("../../temas/".$this->map.".map"); | |
| 835 | + $temp = $this->map; | |
| 836 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | |
| 837 | + {$this->map = "../../aplicmap/geral1windows.map";} | |
| 838 | + else | |
| 839 | + {$this->map = "../../aplicmap/geral1.map";} | |
| 834 | 840 | $this->map_object = ms_newMapObj($this->map); |
| 841 | + $this->map_object->setmetadata('wms_onlineresource',"../../ogc.php?tema=".$temp."&width=500&height=500&"); | |
| 842 | + for ($i=0;$i < ($this->map_object->numlayers);$i++) | |
| 843 | + { | |
| 844 | + $l = $this->map_object->getlayer($i); | |
| 845 | + $l->set("status",MS_DELETE); | |
| 846 | + } | |
| 847 | + for ($i=0;$i < ($maptemp->numlayers);$i++) | |
| 848 | + { | |
| 849 | + $l = $maptemp->getlayer($i); | |
| 850 | + $l->set("status",MS_DEFAULT); | |
| 851 | + $l->set("type",MS_LAYER_RASTER); | |
| 852 | + /* | |
| 853 | + $numclasses = $l->numclasses; | |
| 854 | + for ($c=0; $c < $numclasses; $c++) | |
| 855 | + { | |
| 856 | + $classe = $l->getClass($c); | |
| 857 | + $e = $classe->getstyle(0); | |
| 858 | + $cor[$c] = $e->color; | |
| 859 | + if ($cor[$c] != "") | |
| 860 | + { | |
| 861 | + $ocor[$c] = $e->outlinecolor; | |
| 862 | + $ocor[$c]->setrgb($cor[$c]->red,$cor[$c]->green,$cor[$c]->blue); | |
| 863 | + } | |
| 864 | + } | |
| 865 | + */ | |
| 866 | + ms_newLayerObj($this->map_object, $l); | |
| 867 | + } | |
| 835 | 868 | if(!$this->map_object){ |
| 836 | 869 | $this->set_error('Cannot load mapfile '. $this->map); |
| 837 | 870 | } | ... | ... |
pacotes/kmlmapserver/kmlservice.php
| ... | ... | @@ -22,6 +22,8 @@ This file is part of KMLMAPSERVER. |
| 22 | 22 | along with KMLMAPSERVER; if not, write to the Free Software |
| 23 | 23 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 | 24 | |
| 25 | +http://localhost/i3geo/pacotes/kmlmapserver/kmlservice.php?map=x | |
| 26 | +http://10.1.1.34:80/i3geo/pacotes/kmlmapserver/kmlservice.php?map=bioma&typename=bioma&request=kml | |
| 25 | 27 | */ |
| 26 | 28 | error_reporting(0); |
| 27 | 29 | set_time_limit(0); | ... | ... |