forked from marsprj/Map5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/marsprj/Map5
- Loading branch information
Showing
14 changed files
with
937 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.