i3geo.js
4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
i3geo - carregador de javascripts
Esse arquivo e mantido apenas para compatibilidade com instalacoes que usem a carga de javascript com o nome i3geo.js.
Para uso atual, prefira o arquivo que contem a versao no nome, exemplo i3geo5.js
Para uso nas interfaces HTML.
Lê o conjunto de javascripts para o funcionamento do i3geo.
Carrega o arquivo compactado i3geo_tudo_compacto.js.php
Veja exemplo em <geral.htm>
Arquivo:
i3geo/classesjs/i3geo.js
Licença:
GPL2
i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil
Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
Este programa é software livre; você pode redistribuí-lo
e/ou modificá-lo sob os termos da Licença Pública Geral
GNU conforme publicada pela Free Software Foundation;
Este programa é distribuído na expectativa de que seja útil,
porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita
de COMERCIABILIDADE OU ADEQUACÃO A UMA FINALIDADE ESPECÍFICA.
Consulte a Licença Pública Geral do GNU para mais detalhes.
Você deve ter recebido uma cópia da Licença Pública Geral do
GNU junto com este programa; se não, escreva para a
Free Software Foundation, Inc., no endereço
59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
*/
/*
Pega um objeto do documento.
Exemplo: $i("box1")
Parametros:
id - id do objeto
Retorno:
object - objeto javaScript
*/
$i = function(id)
{return document.getElementById(id);};
//para nao dar erro em interfaces com OL 2
OpenLayers = {
ImgPath: "",
Layer: {
OSM: function(opt){
var titulo = "", name = "", url = "", v = false;
if(opt == "Aquarela"){
titulo = "Aquarela";
name = "Aquarela";
url = "http://tile.stamen.com/watercolor/{z}/{x}/{y}.jpg";
v = false;
}
if(opt == "OSM"){
titulo = "OSM";
name = "osm";
url = "http://tile.openstreetmap.org/{z}/{x}/{y}.png";
v = true;
}
if(opt == "Toner"){
titulo = "Toner";
name = "toner";
url = "http://tile.stamen.com/toner/{z}/{x}/{y}.png";
v = false;
}
if(opt == "Toner lite"){
name = "tonerlite";
titulo = "Toner lite";
url = "http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png";
v = false;
}
if(opt == "MapQuest Open Aerial"){
titulo = "MapQuest Open Aerial";
name = "layMapQuestAerial";
url = "http://oatile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg";
v = false;
}
return new ol.layer.Tile({
title : titulo,
visible : v,
isBaseLayer : true,
name : name,
source: new ol.source.OSM({
attributions : [new ol.Attribution({html: 'Atualize as camadas de fundo para OL3'})],
crossOrigin : "anonymous",
url : url
})
});
}
}
};
(function(){
var scriptLocation = "";
var scripts = document.getElementsByTagName('script');
var i = 0;
for (i = 0; i < scripts.length; i++) {
var src = scripts[i].getAttribute('src');
if (src) {
var index = src.lastIndexOf("i3geo.js");
// is it found, at the end of the URL?
if ((index > -1) && (index + "i3geo.js".length == src.length)) {
scriptLocation = src.slice(0, -"i3geo.js".length);
break;
}
}
}
document.write("<link rel='stylesheet' type='text/css' href='" + scriptLocation + "../css/font/material-icons.css'/>");
document.write("<link rel='stylesheet' type='text/css' href='//fonts.googleapis.com/css?family=Roboto:300,400,500,700'>");
//document.write("<link rel='stylesheet' type='text/css' href='" + scriptLocation + "../pacotes/yui290/build/button/assets/skins/sam/button.css'></link>");
document.write("<link rel='stylesheet' type='text/css' href='" + scriptLocation + "../css/i3geo7.css.php'></link>");
document.write("<script type='text/javascript' src='" + scriptLocation + "i3geo_tudo_compacto7.js.php'></script>");
})();