Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/marsprj/Map5
Browse files Browse the repository at this point in the history
  • Loading branch information
marsprj committed Sep 22, 2016
2 parents 7310493 + 932d710 commit 0b07883
Show file tree
Hide file tree
Showing 14 changed files with 937 additions and 362 deletions.
173 changes: 173 additions & 0 deletions example/all/Format/wkt.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" type="text/css" href="../../../lib/css/Map5.min.css">

<script type="text/javascript" src="../../../src/depends/jquery-1.11.1.js"></script>
<script type="text/javascript" src="../../../src/depends/bootstrap.min.js"></script>

<!--Base-->
<script type="text/javascript" src="../../../src/GeoBeans.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/BaseTypes/Class.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/BaseTypes/Color.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/BaseTypes/Envelope.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Utility/Utility.js"></script>

<!--View-->
<script type="text/javascript" src="../../../src/GeoBeans/Render/Viewer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Renderer.js"></script>
<!--Geometry-->
<script type="text/javascript" src="../../../src/GeoBeans/Geometry.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Geometry/Point.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Geometry/LineString.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Geometry/Line/LinearRing.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Geometry/Polygon.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Geometry/MultiPoint.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Geometry/MultiLineString.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Geometry/MultiPolygon.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Geometry/Circle.js"></script>
<!--Stype-->
<script type="text/javascript" src="../../../src/GeoBeans/Style.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Symbolizer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Style/Font.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Style/Fill.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Style/Stroke.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Style/PointSymbolizer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Style/LineSymbolizer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Style/PolygonSymbolizer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Style/FeatureStyle.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Style/Rule.js"></script>
<!--Control-->
<script type="text/javascript" src="../../../src/GeoBeans/Control.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Control/DragMapControl.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Control/ScrollMapControl.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Control/TrackControl.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Control/TrackControl/TrackOverlayControl.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Control/ZoomControl.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Control/MapNavControl.js"></script>
<!--Format-->
<script type="text/javascript" src="../../../src/GeoBeans/Format/GML.js"></script>
<!--Filter-->
<script type="text/javascript" src="../../../src/GeoBeans/Filter.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Filter/SpatialFilter.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Filter/SpatialFilter/BBoxFilter.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Filter/FilterWriter.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Filter/OrderBy.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Query.js"></script>

<!--Workspace-->
<script type="text/javascript" src="../../../src/GeoBeans/Field.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Feature.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/FeatureType.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Workspace.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Source/Workspace/WFS/WFSWorkspace.js"></script>
<!--Layer-->
<script type="text/javascript" src="../../../src/GeoBeans/Layer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/FeatureLayer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/OverlayLayer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/QueryLayer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/PanoramaLayer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/ImageLayer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/Tile.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/TileCache.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/TileLayer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/TileLayer/QSLayer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/ChartLayer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/ThematicLayer/RippleLayer.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Layer/FeatureLayer/WFSLayer.js"></script>
<!--Interaction-->
<script type="text/javascript" src="../../../src/GeoBeans/Interaction.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Interaction/Draw.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Interaction/Select.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Interaction/Rotate.js"></script>
<!--Events-->
<script type="text/javascript" src="../../../src/GeoBeans/Events.js"></script>
<!--Render-->
<script type="text/javascript" src="../../../src/GeoBeans/Render/Label/Maplex.js"></script>
<!--Widget-->
<script type="text/javascript" src="../../../src/GeoBeans/Widget.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Widget/CopyRightWidget.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Widget/InfoWindowWidget.js"></script>
<script type="text/javascript" src="../../../src/GeoBeans/Widget/LegendWidget.js"></script>

<!-- format -->
<script type="text/javascript" src="../../../src/GeoBeans/Format/WKT.js"></script>
<!--Map-->
<script type="text/javascript" src="../../../src/GeoBeans/Map.js"></script>

<script type="text/javascript" src="../js/initMap.js"></script>

<style type="text/css">
body{
margin: 0px;
}
input{
width: 300px;
}
</style>
<script type="text/javascript">
// 地图变量
var mapObj = null;

var geometry = null;
function init(){

loadTileMap();
}

function wktFormat(){
var wkt = "POINT (30 10)";
// var wkt = "LINESTRING (30 10, 10 30, 40 40)";
// var wkt = "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))";
// var wkt = "POLYGON ((35 10, 45 45, 15 40, 10 20, 35 10),(20 30, 35 35, 30 20, 20 30))";
// var wkt = "MULTIPOINT(3.5 5.6, 4.8 10.5)";
// var wkt = "MULTILINESTRING ((10 10, 20 20, 10 40),(40 40, 30 30, 40 20, 30 10))";
// var wkt = "MULTIPOLYGON (((30 20, 45 40, 10 40, 30 20)),((15 5, 40 10, 10 20, 5 10, 15 5)))";
// var wkt = "MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)),((20 35, 10 30, 10 10, 30 5, 45 20, 20 35),(30 20, 20 15, 20 25, 30 20)))";
// var wkt = "MULTIPOLYGON (((20 35, 10 30, 10 10, 30 5, 45 20, 20 35)))";

var wktFormat = new GeoBeans.WKTFormat();
var geometry = wktFormat.read(wkt);
console.log(geometry);

var wktWrite = wktFormat.write(geometry);
console.log(wktWrite);

var geometryRead = wktFormat.read(wktWrite);
console.log(geometryRead);
}

function toGeometry(){
var wkt = $("#wkt").val();
var wktFormat = new GeoBeans.WKTFormat();
geometry = wktFormat.read(wkt);
if(geometry != null){
$("#geometry").val(geometry.type);
}
}

function toWKT(){
if(geometry == null){
return;
}
var wktFormat = new GeoBeans.WKTFormat();
var wktWrite = wktFormat.write(geometry);
$("#wkt_write").val(wktWrite);
}
</script>
<title>格式:geometry与WKT转换</title>
<body onload="init()">
<!-- mapDiv 为初始化地图的容器,给定高度和宽度,并指定定位方式为绝对定位 -->
<div id="mapDiv" style="height:800px;width:100%;position:absolute;top:80px;">
</div>
<!-- <button onclick="wktFormat()">转换</button> -->
<input type="text" value="POINT (30 10)" id="wkt"><br/>
<button onclick="toGeometry()">wkt=>geometry</button>
<input type="text" id="geometry" disabled>
<br/>
<button onclick="toWKT()">geometry=>wkt</button>
<input type="text" id="wkt_write" disabled="">
</body>

6 changes: 5 additions & 1 deletion example/all/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@
}

ul.children li.active{
color:
color: #0097c3;
font-weight: bold;
}
.right_tab{
height: 100%;
Expand Down Expand Up @@ -227,6 +228,7 @@
}

$("#item_list").html(html);
$("#item_list .children:first li:first").addClass("active");

$("#item_list .item-li a").click(function(){
var parent = $(this).parent();
Expand All @@ -239,6 +241,8 @@


$("#item_list .children li").click(function(){
$("#item_list .children li").removeClass("active");
$(this).addClass("active");
var link = $(this).attr("xlink");
if(link != null && link != ""){
$(".right_tab").hide();
Expand Down
122 changes: 99 additions & 23 deletions example/all/js/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,20 @@ var g_catalog = [
"name" : "图层样式",
"items":[
{
"name" : "(*)点样式",
"link" : "style_point.html"
"name" : "(*)点样式(简单)",
"link" : "style_simple_point.html"
},{
"name" : "(*)线样式",
"link" : "style_line.html"
"name" : "(*)点样式(图片)",
"link" : "style_pic_point.html"
},{
"name" : "(*)面样式",
"link" : "style_polygon.html"
"name" : "(*)线样式(简单)",
"link" : "style_simple_line.html"
},{
"name" : "(*)面样式(简单)",
"link" : "style_simple_polygon.html"
},{
"name" : "(*)面样式(填充)",
"link" : "style_fill_polygon.html"
},{
"name" : "(*)文字样式(点)",
"link" : "style_text_point.html"
Expand Down Expand Up @@ -272,7 +278,7 @@ var g_catalog = [
}
]
},{
"name" : "WFS查询",
"name" : "要素查询",
"items":[
{
"name" : "(*)点击查询",
Expand All @@ -294,7 +300,7 @@ var g_catalog = [
"link" : "logicFilterQuery.html"
}
]
},{
},/*{
"name" : "要素图层查询",
"items":[
{
Expand All @@ -308,27 +314,42 @@ var g_catalog = [
"link" : "featureLayerComparisionFilterQuery.html"
}
]
},{
},*/{
"name" : "标注",
"items":[
{
"name" : "(*)marker标注",
"link" : "marker.html"
"name" : "(*)点标注",
"link" : "label/label_marker.html"
},{
"name" : "(*)线标注",
"link" : "polyline.html"
"link" : "label/label_line.html"
},{
"name" : "(*)面标注",
"link" : "polygon.html"
"link" : "label/label_polygon.html"
},{
"name" : "(*)文字标注(点)",
"link" : "label/label_text_point.html"
},{
"name" : "(*)文字标注(线)",
"link" : "label/label_text_line.html"
},{
"name" : "(*)文字标注(面)",
"link" : "label/label_text_polygon.html"
},{
"name" : "(*)文字标注",
"link" : "label.html"
"name" : "(*)碰撞检测",
"link" : "label/label_collision.html"
},{
"name" : "(*)infoWindow标注",
"link" : "infoWindow.html"
"name" : "(*)标注信息窗",
"link" : "label/label_infoWindow.html"
},{
"name" : "(*)标注操作",
"name" : "(*??)标注操作",
"link" : "overlay.html"
},{
"name" : "(*)事件(点击)",
"link" : "label/event_click.html"
},{
"name" : "(*)事件(hover)",
"link" : "label/event_hover.html"
}
]
},{
Expand All @@ -343,20 +364,58 @@ var g_catalog = [
}
]
},{
"name" : "事件",
"name" : "地图事件",
"items":[
{
"name" : "(*)单击事件",
"link" : "event/map_click.html"
},{
"name" : "(*)双击事件",
"link" : "event/map_dbclick.html"
},{
"name" : "(*)鼠标按下事件",
"link" : "event/map_mouse_down.html"
},{
"name" : "(*)鼠标按下事件",
"link" : "event/map_mouse_down.html"
},{
"name" : "(*)鼠标移动事件",
"link" : "event.html"
"link" : "event/map_mouse_move.html"
},{
"name" : "(*)拖拽事件",
"link" : "dragEvent.html"
"name" : "(*)鼠标抬起事件",
"link" : "event/map_mouse_up.html"
},{
"name" : "(*)鼠标滚动事件",
"link" : "wheelEvent.html"
"link" : "event/map_mouse_wheel.html"
},{
"name" : "(*)地图拖拽事件",
"link" : "event/map_drag.html"
}
]
},{
"name" : "数据源事件",
"items":[
{
"name" : "(*)Image加载开始事件",
"link" : "event/image_load_start.html"
},{
"name" : "(*)Image加载成功事件",
"link" : "event/image_load_end.html"
},{
"name" : "(*)Image加载错误事件",
"link" : "event/image_load_error.html"
}/*,{
"name" : "(*)Image加载开始事件",
"link" : "event/image_load_start.html"
},{
"name" : "(*)Image加载成功事件",
"link" : "event/image_load_end.html"
},{
"name" : "(*)Image加载错误事件",
"link" : "event/image_load_error.html"
},*/
]
}/*,{
"name" : "加载KML文件",
"items":[
{
Expand Down Expand Up @@ -402,6 +461,23 @@ var g_catalog = [
"link" : "geojson_example_3.html"
}
]
}*/,{
"name" : "格式转换",
"items":[
{
"name" : "(*)WKT<-->Geometry",
"link" : "Format/wkt.html"
},{
"name" : "(*)GML<-->Geometry",
"link" : "format_gmal.html"
},{
"name" : "(*)KML<-->Geometry",
"link" : "format_gmal.html"
},{
"name" : "(*)GeoJSON<-->Geometry",
"link" : "format_gmal.html"
}
]
},{
"name" : "动画",
"items":[
Expand Down
2 changes: 1 addition & 1 deletion example/all/layer/layer_add_baidu.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
}

</script>
<title>图层:添加高德图层</title>
<title>图层:添加百度图层</title>
<body onload="init()">
<!-- mapDiv 为初始化地图的容器,给定高度和宽度,并指定定位方式为绝对定位 -->
<div id="mapDiv" style="height:800px;width:100%;position:absolute;top:80px;">
Expand Down
Loading

0 comments on commit 0b07883

Please sign in to comment.