Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
d37e93d6
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d37e93d6
编写于
4月 01, 2019
作者:
S
Serge Rider
提交者:
GitHub
4月 01, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5627 from Sertarus/PostGIS-development
Looks good Former-commit-id:
3a5ef869
上级
9a5767af
8e6e0b79
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
54 addition
and
75 deletion
+54
-75
plugins/org.jkiss.dbeaver.data.gis.view/web/view_template.html
...ns/org.jkiss.dbeaver.data.gis.view/web/view_template.html
+54
-75
未找到文件。
plugins/org.jkiss.dbeaver.data.gis.view/web/view_template.html
浏览文件 @
d37e93d6
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html
style=
"height: 100%;"
>
<head>
<head>
<title>
Quick Start - Leaflet
</title>
<title>
Quick Start - Leaflet
</title>
<meta
charset=
"utf-8"
/>
<meta
charset=
"utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<link
rel=
"stylesheet"
href=
"inc/leaflet.css"
/>
<link
rel=
"stylesheet"
href=
"inc/leaflet.css"
/>
<script
src=
"inc/leaflet.js"
></script>
<script
src=
"inc/leaflet.js"
></script>
<script
src=
"inc/wkx.min.js"
></script>
<script
src=
"inc/wkx.min.js"
></script>
</head>
</head>
<body>
<div
id=
"mapid"
style=
"width: 100%; height: 400px;"
></div>
<script>
var
wkx
=
require
(
'
wkx
'
);
var
mymap
=
L
.
map
(
'
mapid
'
);
//.setView([51.505, -0.09], 13);
L
.
tileLayer
(
'
https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw
'
,
{
maxZoom
:
18
,
attribution
:
'
Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors
'
+
'
<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>,
'
+
'
Imagery <a href="https://www.mapbox.com/">Mapbox</a>
'
,
id
:
'
mapbox.streets
'
}).
addTo
(
mymap
);
const
geojsonMarkerOptions
=
{
<body
style=
"height: 100%; margin: 0;"
>
radius
:
4
,
weight
:
3
,
};
const
geojsonStyle
=
{
weight
:
2
,
};
const
popupOption
=
{
closeButton
:
false
,
minWidth
:
260
,
maxWidth
:
300
,
maxHeight
:
300
,
};
var
vectorLayer
=
L
.
geoJSON
([],
{
<div
id=
"mapid"
style=
"width: 100%; height: 100%;"
></div>
style
:
geojsonStyle
,
<script>
pointToLayer
:
function
(
feature
,
latlng
)
{
var
wkx
=
require
(
'
wkx
'
);
return
L
.
circleMarker
(
latlng
,
geojsonMarkerOptions
);
var
mymap
=
L
.
map
(
'
mapid
'
);
//.setView([51.505, -0.09], 13);
},
});
vectorLayer
.
addTo
(
mymap
);
var
polyTest
=
wkx
.
Geometry
.
parse
(
'
${geomValue}
'
);
L
.
tileLayer
(
'
https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw
'
,
{
var
geoJSON
=
polyTest
.
toGeoJSON
();
maxZoom
:
18
,
var
SRID
=
geoJSON
.
selectedSRID
;
attribution
:
'
Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors
'
+
vectorLayer
.
addData
(
geoJSON
);
'
<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>,
'
+
'
Imagery <a href="https://www.mapbox.com/">Mapbox</a>
'
,
id
:
'
mapbox.streets
'
}).
addTo
(
mymap
);
var
bounds
=
vectorLayer
.
getBounds
();
const
geojsonMarkerOptions
=
{
/*
radius
:
4
,
bounds = bounds.pad(0.1);
weight
:
3
,
let maxLength = Math.max(bounds.getNorth() - bounds.getSouth(),
};
bounds.getEast() - bounds.getWest());
const
geojsonStyle
=
{
if (SRID === 4326) {
weight
:
2
,
alert("setEPSG3857");
};
setEPSG3857();
const
popupOption
=
{
} else {
closeButton
:
false
,
//setSimpleCRS();
minWidth
:
260
,
if (maxLength >= 180) {
maxWidth
:
300
,
// calculate the min zoom level to enable the map to fit the whole geometry.
maxHeight
:
300
,
let minZoom = Math.floor(Math.log2(360 / maxLength)) - 2;
};
mymap.setMinZoom(minZoom);
} else {
mymap.setMinZoom(0);
}
}
*/
mymap
.
setView
(
bounds
.
getCenter
(),
13
);
//mymap.getZoom());
var
vectorLayer
=
L
.
geoJSON
([],
{
style
:
geojsonStyle
,
pointToLayer
:
function
(
feature
,
latlng
)
{
return
L
.
circleMarker
(
latlng
,
geojsonMarkerOptions
);
},
});
vectorLayer
.
addTo
(
mymap
);
var
popup
=
L
.
popup
();
var
polyTest
=
wkx
.
Geometry
.
parse
(
'
${geomValue}
'
);
var
geoJSON
=
polyTest
.
toGeoJSON
();
var
SRID
=
geoJSON
.
selectedSRID
;
vectorLayer
.
addData
(
geoJSON
);
function
onMapClick
(
e
)
{
var
bounds
=
vectorLayer
.
getBounds
();
popup
mymap
.
fitBounds
(
bounds
);
.
setLatLng
(
e
.
latlng
)
.
setContent
(
"
You clicked the map at
"
+
e
.
latlng
.
toString
())
.
openOn
(
mymap
);
}
mymap
.
on
(
'
click
'
,
onMapClick
);
</script>
var
popup
=
L
.
popup
();
function
onMapClick
(
e
)
{
popup
.
setLatLng
(
e
.
latlng
)
.
setContent
(
"
You clicked the map at
"
+
e
.
latlng
.
toString
())
.
openOn
(
mymap
);
}
mymap
.
on
(
'
click
'
,
onMapClick
);
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录