Commit 822b800946283237232c325fc09abb506643656d
1 parent
8ad52097
Exists in
master
and in
7 other branches
Inclusão de parâmetros para controle da esacal gráfica e legenda em ogc.php
Showing
5 changed files
with
175 additions
and
113 deletions
Show diff stats
aplicmap/ogcws.map
@@ -22,7 +22,6 @@ MAP | @@ -22,7 +22,6 @@ MAP | ||
22 | TRANSPARENT TRUE | 22 | TRANSPARENT TRUE |
23 | FORMATOPTION "INTERLACE=OFF" | 23 | FORMATOPTION "INTERLACE=OFF" |
24 | END | 24 | END |
25 | - | ||
26 | PROJECTION | 25 | PROJECTION |
27 | "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" | 26 | "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" |
28 | END | 27 | END |
aplicmap/ogcwsv7.map
@@ -15,6 +15,7 @@ MAP | @@ -15,6 +15,7 @@ MAP | ||
15 | DEBUG OFF | 15 | DEBUG OFF |
16 | #DEBUG 5 | 16 | #DEBUG 5 |
17 | #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt" | 17 | #CONFIG "MS_ERRORFILE" "/tmp/ms_tmp/ms_error.txt" |
18 | + | ||
18 | OUTPUTFORMAT | 19 | OUTPUTFORMAT |
19 | NAME 'png' | 20 | NAME 'png' |
20 | MIMETYPE "image/png" | 21 | MIMETYPE "image/png" |
ogc.php
@@ -938,123 +938,14 @@ else{ | @@ -938,123 +938,14 @@ else{ | ||
938 | // | 938 | // |
939 | //a imagem do mapa recebera a legenda | 939 | //a imagem do mapa recebera a legenda |
940 | // | 940 | // |
941 | - $legenda = $_GET["legenda"]; | ||
942 | - if((isset($legenda)) && (strtolower($legenda) == "sim")){ | ||
943 | - $leg = $oMap->legend; | ||
944 | - $leg->set("status",MS_EMBED); | ||
945 | - if(!empty($_GET["legenda_imagecolor"])){ | ||
946 | - $_GET["legenda_imagecolor"] = str_replace(","," ",$_GET["legenda_imagecolor"]); | ||
947 | - $ncor = explode(" ",$_GET["legenda_imagecolor"]); | ||
948 | - $cor = $leg->imagecolor; | ||
949 | - $cor->setRGB($ncor[0],$ncor[1],$ncor[2]); | ||
950 | - $req->setParameter("TRANSPARENT",0); | ||
951 | - } | ||
952 | - if(!empty($_GET["legenda_keysizex"])){ | ||
953 | - $leg->set("keysizex",$_GET["legenda_keysizex"]); | ||
954 | - } | ||
955 | - if(!empty($_GET["legenda_keysizey"])){ | ||
956 | - $leg->set("keysizey",$_GET["legenda_keysizey"]); | ||
957 | - } | ||
958 | - if(!empty($_GET["legenda_keyspacingx"])){ | ||
959 | - $leg->set("keyspacingx",$_GET["legenda_keyspacingx"]); | ||
960 | - } | ||
961 | - //ul|uc|ur|ll|lc|lr | ||
962 | - if(!empty($_GET["legenda_position"])){ | ||
963 | - if($_GET["legenda_position"] == "ul") $leg->set("position",MS_UL); | ||
964 | - if($_GET["legenda_position"] == "uc") $leg->set("position",MS_UC); | ||
965 | - if($_GET["legenda_position"] == "ur") $leg->set("position",MS_UR); | ||
966 | - if($_GET["legenda_position"] == "ll") $leg->set("position",MS_LL); | ||
967 | - if($_GET["legenda_position"] == "lc") $leg->set("position",MS_LC); | ||
968 | - if($_GET["legenda_position"] == "lr") $leg->set("position",MS_LR); | ||
969 | - } | ||
970 | - if(!empty($_GET["legenda_keyspacingy"])){ | ||
971 | - $leg->set("keyspacingy",$_GET["legenda_keyspacingy"]); | ||
972 | - } | ||
973 | - if(!empty($_GET["legenda_outlinecolor"])){ | ||
974 | - $_GET["legenda_outlinecolor"] = str_replace(","," ",$_GET["legenda_outlinecolor"]); | ||
975 | - $ncor = explode(" ",$_GET["legenda_outlinecolor"]); | ||
976 | - $cor = $leg->outlinecolor; | ||
977 | - $cor->setRGB($ncor[0],$ncor[1],$ncor[2]); | ||
978 | - } | ||
979 | - //fonte e size so com truetype | ||
980 | - if (!empty($_GET["legenda_font"])){ | ||
981 | - $label = $leg->label; | ||
982 | - $label->updatefromstring("LABEL TYPE TRUETYPE END"); | ||
983 | - $label->set("font",$_GET["legenda_font"]); | ||
984 | - } | ||
985 | - if (!empty($_GET["legenda_size"])){ | ||
986 | - $label = $leg->label; | ||
987 | - $label->updatefromstring("LABEL TYPE TRUETYPE END"); | ||
988 | - if(empty($_GET["legenda_font"])){ | ||
989 | - $label->set("font","arial"); | ||
990 | - } | ||
991 | - $label->set("size",$_GET["legenda_size"]); | ||
992 | - } | 941 | + if((isset($_GET["legenda"])) && (strtolower($_GET["legenda"]) == "sim")){ |
942 | + processaLegenda(); | ||
993 | } | 943 | } |
994 | // | 944 | // |
995 | //a imagem do mapa recebera a barra de escala | 945 | //a imagem do mapa recebera a barra de escala |
996 | // | 946 | // |
997 | if((isset($_GET["escala"])) && (strtolower($_GET["escala"]) == "sim")){ | 947 | if((isset($_GET["escala"])) && (strtolower($_GET["escala"]) == "sim")){ |
998 | - $eb = $oMap->scalebar; | ||
999 | - $eb->set("status",MS_EMBED); | ||
1000 | - if(!empty($_GET["escala_width"])){ | ||
1001 | - $eb->set("width",$_GET["escala_width"]); | ||
1002 | - } | ||
1003 | - if(!empty($_GET["escala_height"])){ | ||
1004 | - $eb->set("height",$_GET["escala_height"]); | ||
1005 | - } | ||
1006 | - //0 ou 1 | ||
1007 | - if(!empty($_GET["escala_style"])){ | ||
1008 | - $eb->set("style",$_GET["escala_style"]); | ||
1009 | - } | ||
1010 | - if(!empty($_GET["escala_intervals"])){ | ||
1011 | - $eb->set("intervals",$_GET["escala_intervals"]); | ||
1012 | - } | ||
1013 | - //MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD, MS_PIXELS, MS_NAUTICALMILES | ||
1014 | - if(!empty($_GET["escala_units"])){ | ||
1015 | - $eb->set("units",$_GET["escala_units"]); | ||
1016 | - } | ||
1017 | - if(!empty($_GET["escala_color"])){ | ||
1018 | - $_GET["escala_color"] = str_replace(","," ",$_GET["escala_color"]); | ||
1019 | - $ncor = explode(" ",$_GET["escala_color"]); | ||
1020 | - $cor = $eb->color; | ||
1021 | - $cor->setRGB($ncor[0],$ncor[1],$ncor[2]); | ||
1022 | - } | ||
1023 | - if(!empty($_GET["escala_backgroundcolor"])){ | ||
1024 | - $_GET["escala_backgroundcolor"] = str_replace(","," ",$_GET["escala_backgroundcolor"]); | ||
1025 | - $ncor = explode(" ",$_GET["escala_backgroundcolor"]); | ||
1026 | - $cor = $eb->backgroundcolor; | ||
1027 | - $cor->setRGB($ncor[0],$ncor[1],$ncor[2]); | ||
1028 | - } | ||
1029 | - if(!empty($_GET["escala_outlinecolor"])){ | ||
1030 | - $_GET["escala_outlinecolor"] = str_replace(","," ",$_GET["escala_outlinecolor"]); | ||
1031 | - $ncor = explode(" ",$_GET["escala_outlinecolor"]); | ||
1032 | - $cor = $eb->outlinecolor; | ||
1033 | - $cor->setRGB($ncor[0],$ncor[1],$ncor[2]); | ||
1034 | - } | ||
1035 | - //ul|uc|ur|ll|lc|lr | ||
1036 | - if(!empty($_GET["escala_position"])){ | ||
1037 | - if($_GET["escala_position"] == "ul") $eb->set("position",MS_UL); | ||
1038 | - if($_GET["escala_position"] == "uc") $eb->set("position",MS_UC); | ||
1039 | - if($_GET["escala_position"] == "ur") $eb->set("position",MS_UR); | ||
1040 | - if($_GET["escala_position"] == "ll") $eb->set("position",MS_LL); | ||
1041 | - if($_GET["escala_position"] == "lc") $eb->set("position",MS_LC); | ||
1042 | - if($_GET["escala_position"] == "lr") $eb->set("position",MS_LR); | ||
1043 | - } | ||
1044 | - //fonte e size so com truetype | ||
1045 | - if (!empty($_GET["escala_font"])){ | ||
1046 | - $label = $eb->label; | ||
1047 | - $label->updatefromstring("LABEL TYPE TRUETYPE END"); | ||
1048 | - $label->set("font",$_GET["escala_font"]); | ||
1049 | - } | ||
1050 | - if (!empty($_GET["escala_size"])){ | ||
1051 | - $label = $eb->label; | ||
1052 | - $label->updatefromstring("LABEL TYPE TRUETYPE END"); | ||
1053 | - if(empty($_GET["escala_size"])){ | ||
1054 | - $label->set("font","arial"); | ||
1055 | - } | ||
1056 | - $label->set("size",$_GET["escala_size"]); | ||
1057 | - } | 948 | + processaEscala(); |
1058 | } | 949 | } |
1059 | $oMap->setSymbolSet($locaplic."/symbols/".basename($oMap->symbolsetfilename)); | 950 | $oMap->setSymbolSet($locaplic."/symbols/".basename($oMap->symbolsetfilename)); |
1060 | $oMap->setFontSet($locaplic."/symbols/".basename($oMap->fontsetfilename)); | 951 | $oMap->setFontSet($locaplic."/symbols/".basename($oMap->fontsetfilename)); |
@@ -1909,6 +1800,122 @@ function processaPluginI3geo(){ | @@ -1909,6 +1800,122 @@ function processaPluginI3geo(){ | ||
1909 | } | 1800 | } |
1910 | } | 1801 | } |
1911 | } | 1802 | } |
1803 | +function processaEscala(){ | ||
1804 | + global $oMap, $locaplic, $req; | ||
1805 | + $eb = $oMap->scalebar; | ||
1806 | + $eb->set("status",MS_EMBED); | ||
1807 | + if(!empty($_GET["escala_width"])){ | ||
1808 | + $eb->set("width",$_GET["escala_width"]); | ||
1809 | + } | ||
1810 | + if(!empty($_GET["escala_height"])){ | ||
1811 | + $eb->set("height",$_GET["escala_height"]); | ||
1812 | + } | ||
1813 | + //0 ou 1 | ||
1814 | + if(!empty($_GET["escala_style"])){ | ||
1815 | + $eb->set("style",$_GET["escala_style"]); | ||
1816 | + } | ||
1817 | + if(!empty($_GET["escala_intervals"])){ | ||
1818 | + $eb->set("intervals",$_GET["escala_intervals"]); | ||
1819 | + } | ||
1820 | + //MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD, MS_PIXELS, MS_NAUTICALMILES | ||
1821 | + if(!empty($_GET["escala_units"])){ | ||
1822 | + $eb->set("units",$_GET["escala_units"]); | ||
1823 | + } | ||
1824 | + if(!empty($_GET["escala_color"])){ | ||
1825 | + $_GET["escala_color"] = str_replace(","," ",$_GET["escala_color"]); | ||
1826 | + $ncor = explode(" ",$_GET["escala_color"]); | ||
1827 | + $cor = $eb->color; | ||
1828 | + $cor->setRGB($ncor[0],$ncor[1],$ncor[2]); | ||
1829 | + } | ||
1830 | + if(!empty($_GET["escala_backgroundcolor"])){ | ||
1831 | + $_GET["escala_backgroundcolor"] = str_replace(","," ",$_GET["escala_backgroundcolor"]); | ||
1832 | + $ncor = explode(" ",$_GET["escala_backgroundcolor"]); | ||
1833 | + $cor = $eb->backgroundcolor; | ||
1834 | + $cor->setRGB($ncor[0],$ncor[1],$ncor[2]); | ||
1835 | + } | ||
1836 | + if(!empty($_GET["escala_outlinecolor"])){ | ||
1837 | + $_GET["escala_outlinecolor"] = str_replace(","," ",$_GET["escala_outlinecolor"]); | ||
1838 | + $ncor = explode(" ",$_GET["escala_outlinecolor"]); | ||
1839 | + $cor = $eb->outlinecolor; | ||
1840 | + $cor->setRGB($ncor[0],$ncor[1],$ncor[2]); | ||
1841 | + } | ||
1842 | + //ul|uc|ur|ll|lc|lr | ||
1843 | + if(!empty($_GET["escala_position"])){ | ||
1844 | + if($_GET["escala_position"] == "ul") $eb->set("position",MS_UL); | ||
1845 | + if($_GET["escala_position"] == "uc") $eb->set("position",MS_UC); | ||
1846 | + if($_GET["escala_position"] == "ur") $eb->set("position",MS_UR); | ||
1847 | + if($_GET["escala_position"] == "ll") $eb->set("position",MS_LL); | ||
1848 | + if($_GET["escala_position"] == "lc") $eb->set("position",MS_LC); | ||
1849 | + if($_GET["escala_position"] == "lr") $eb->set("position",MS_LR); | ||
1850 | + } | ||
1851 | + //fonte e size so com truetype | ||
1852 | + if (!empty($_GET["escala_font"])){ | ||
1853 | + $label = $eb->label; | ||
1854 | + $label->updatefromstring("LABEL TYPE TRUETYPE END"); | ||
1855 | + $label->set("font",$_GET["escala_font"]); | ||
1856 | + } | ||
1857 | + if (!empty($_GET["escala_size"])){ | ||
1858 | + $label = $eb->label; | ||
1859 | + $label->updatefromstring("LABEL TYPE TRUETYPE END"); | ||
1860 | + if(empty($_GET["escala_size"])){ | ||
1861 | + $label->set("font","arial"); | ||
1862 | + } | ||
1863 | + $label->set("size",$_GET["escala_size"]); | ||
1864 | + } | ||
1865 | +} | ||
1866 | +function processaLegenda(){ | ||
1867 | + global $oMap, $locaplic, $req; | ||
1868 | + $leg = $oMap->legend; | ||
1869 | + $leg->set("status",MS_EMBED); | ||
1870 | + if(!empty($_GET["legenda_imagecolor"])){ | ||
1871 | + $_GET["legenda_imagecolor"] = str_replace(","," ",$_GET["legenda_imagecolor"]); | ||
1872 | + $ncor = explode(" ",$_GET["legenda_imagecolor"]); | ||
1873 | + $cor = $leg->imagecolor; | ||
1874 | + $cor->setRGB($ncor[0],$ncor[1],$ncor[2]); | ||
1875 | + $req->setParameter("TRANSPARENT",0); | ||
1876 | + } | ||
1877 | + if(!empty($_GET["legenda_keysizex"])){ | ||
1878 | + $leg->set("keysizex",$_GET["legenda_keysizex"]); | ||
1879 | + } | ||
1880 | + if(!empty($_GET["legenda_keysizey"])){ | ||
1881 | + $leg->set("keysizey",$_GET["legenda_keysizey"]); | ||
1882 | + } | ||
1883 | + if(!empty($_GET["legenda_keyspacingx"])){ | ||
1884 | + $leg->set("keyspacingx",$_GET["legenda_keyspacingx"]); | ||
1885 | + } | ||
1886 | + //ul|uc|ur|ll|lc|lr | ||
1887 | + if(!empty($_GET["legenda_position"])){ | ||
1888 | + if($_GET["legenda_position"] == "ul") $leg->set("position",MS_UL); | ||
1889 | + if($_GET["legenda_position"] == "uc") $leg->set("position",MS_UC); | ||
1890 | + if($_GET["legenda_position"] == "ur") $leg->set("position",MS_UR); | ||
1891 | + if($_GET["legenda_position"] == "ll") $leg->set("position",MS_LL); | ||
1892 | + if($_GET["legenda_position"] == "lc") $leg->set("position",MS_LC); | ||
1893 | + if($_GET["legenda_position"] == "lr") $leg->set("position",MS_LR); | ||
1894 | + } | ||
1895 | + if(!empty($_GET["legenda_keyspacingy"])){ | ||
1896 | + $leg->set("keyspacingy",$_GET["legenda_keyspacingy"]); | ||
1897 | + } | ||
1898 | + if(!empty($_GET["legenda_outlinecolor"])){ | ||
1899 | + $_GET["legenda_outlinecolor"] = str_replace(","," ",$_GET["legenda_outlinecolor"]); | ||
1900 | + $ncor = explode(" ",$_GET["legenda_outlinecolor"]); | ||
1901 | + $cor = $leg->outlinecolor; | ||
1902 | + $cor->setRGB($ncor[0],$ncor[1],$ncor[2]); | ||
1903 | + } | ||
1904 | + //fonte e size so com truetype | ||
1905 | + if (!empty($_GET["legenda_font"])){ | ||
1906 | + $label = $leg->label; | ||
1907 | + $label->updatefromstring("LABEL TYPE TRUETYPE END"); | ||
1908 | + $label->set("font",$_GET["legenda_font"]); | ||
1909 | + } | ||
1910 | + if (!empty($_GET["legenda_size"])){ | ||
1911 | + $label = $leg->label; | ||
1912 | + $label->updatefromstring("LABEL TYPE TRUETYPE END"); | ||
1913 | + if(empty($_GET["legenda_font"])){ | ||
1914 | + $label->set("font","arial"); | ||
1915 | + } | ||
1916 | + $label->set("size",$_GET["legenda_size"]); | ||
1917 | + } | ||
1918 | +} | ||
1912 | //utilizada para obter os dados default quando se utiliza o plugin parametrossql | 1919 | //utilizada para obter os dados default quando se utiliza o plugin parametrossql |
1913 | function execProg($prog){ | 1920 | function execProg($prog){ |
1914 | //$retorno variavel deve ser retornada pelo programa $prog | 1921 | //$retorno variavel deve ser retornada pelo programa $prog |
@@ -0,0 +1,22 @@ | @@ -0,0 +1,22 @@ | ||
1 | +MAP | ||
2 | +SYMBOLSET ../symbols/simbolosv6.sym | ||
3 | +FONTSET "../symbols/fontes.txt" | ||
4 | +LAYER | ||
5 | + NAME "_estadosbr" # ok | ||
6 | + TYPE line | ||
7 | + STATUS DEFAULT | ||
8 | + DATA "/var/www/i3geo/aplicmap/dados/estados.shp" | ||
9 | + TEMPLATE "none.htm" | ||
10 | + METADATA | ||
11 | + "TEMA" "Limite Estadual" | ||
12 | + "CLASSE" "SIM" | ||
13 | + "permiteogc" "sim" | ||
14 | + END | ||
15 | + CLASS | ||
16 | + NAME "" | ||
17 | + STYLE | ||
18 | + COLOR 0 0 0 | ||
19 | + END | ||
20 | + END # CLASS | ||
21 | +END # LAYER | ||
22 | +END |
@@ -0,0 +1,33 @@ | @@ -0,0 +1,33 @@ | ||
1 | +MAP | ||
2 | +SYMBOLSET ../symbols/simbolosv6.sym | ||
3 | +FONTSET "../symbols/fontes.txt" | ||
4 | +LAYER | ||
5 | + NAME "gridg" | ||
6 | + METADATA | ||
7 | + "DESCRIPTION" "Grid" | ||
8 | + "TEMA" "Grade" | ||
9 | + END | ||
10 | + TYPE LINE | ||
11 | + STATUS DEFAULT | ||
12 | + CLASS | ||
13 | + NAME "Graticule" | ||
14 | + COLOR 0 0 0 | ||
15 | + LABEL | ||
16 | + COLOR 255 0 0 | ||
17 | + FONT "arial" | ||
18 | + TYPE truetype | ||
19 | + SIZE 8 | ||
20 | + POSITION AUTO | ||
21 | + PARTIALS FALSE | ||
22 | + BUFFER 2 | ||
23 | + OUTLINECOLOR 255 255 255 | ||
24 | + END | ||
25 | + END | ||
26 | + PROJECTION | ||
27 | + "init=epsg:4326" | ||
28 | + END | ||
29 | + GRID | ||
30 | + LABELFORMAT "DD" | ||
31 | + END | ||
32 | +END # Layer | ||
33 | +END | ||
0 | \ No newline at end of file | 34 | \ No newline at end of file |