Addressing @tschaub's review comment.
This commit is contained in:
@@ -11,12 +11,12 @@ function init() {
|
|||||||
layers: [new OpenLayers.Layer.Vector()]
|
layers: [new OpenLayers.Layer.Vector()]
|
||||||
});
|
});
|
||||||
|
|
||||||
var features = [new OpenLayers.Format.WKT().read(
|
var features = [new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT(
|
||||||
'LINESTRING(117 22,112 18,118 13, 115 8)'
|
'LINESTRING(117 22,112 18,118 13, 115 8)'
|
||||||
)];
|
))];
|
||||||
var geometry = (new OpenLayers.Format.WKT().read(
|
var geometry = OpenLayers.Geometry.fromWKT(
|
||||||
'POLYGON((110 20,120 20,120 10,110 10,110 20),(112 17,118 18,118 16,112 15,112 17))'
|
'POLYGON((110 20,120 20,120 10,110 10,110 20),(112 17,118 18,118 16,112 15,112 17))'
|
||||||
)).geometry;
|
);
|
||||||
|
|
||||||
map.baseLayer.addFeatures(features);
|
map.baseLayer.addFeatures(features);
|
||||||
map.baseLayer.addFeatures([new OpenLayers.Feature.Vector(geometry)]);
|
map.baseLayer.addFeatures([new OpenLayers.Feature.Vector(geometry)]);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<script src="OLLoader.js"></script>
|
<script src="OLLoader.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
var wkt = new OpenLayers.Format.WKT();
|
||||||
var process;
|
var process;
|
||||||
var client = new OpenLayers.WPSClient({
|
var client = new OpenLayers.WPSClient({
|
||||||
servers: {
|
servers: {
|
||||||
@@ -82,8 +83,8 @@
|
|||||||
// configured with output identifier
|
// configured with output identifier
|
||||||
process.execute({
|
process.execute({
|
||||||
inputs: {
|
inputs: {
|
||||||
line: new OpenLayers.Format.WKT().read(line),
|
line: wkt.read(line),
|
||||||
polygon: new OpenLayers.Format.WKT().read(polygon)
|
polygon: wkt.read(polygon)
|
||||||
},
|
},
|
||||||
output: 'foo',
|
output: 'foo',
|
||||||
success: success
|
success: success
|
||||||
@@ -91,8 +92,8 @@
|
|||||||
// configured without output identifier
|
// configured without output identifier
|
||||||
process.execute({
|
process.execute({
|
||||||
inputs: {
|
inputs: {
|
||||||
line: new OpenLayers.Format.WKT().read(line),
|
line: wkt.read(line),
|
||||||
polygon: new OpenLayers.Format.WKT().read(polygon)
|
polygon: wkt.read(polygon)
|
||||||
},
|
},
|
||||||
success: success
|
success: success
|
||||||
});
|
});
|
||||||
@@ -130,10 +131,10 @@
|
|||||||
var intersect = client.getProcess('local', 'JTS:intersection');
|
var intersect = client.getProcess('local', 'JTS:intersection');
|
||||||
intersect.configure({
|
intersect.configure({
|
||||||
inputs: {
|
inputs: {
|
||||||
a: new OpenLayers.Format.WKT().read(
|
a: wkt.read(
|
||||||
'LINESTRING(117 22,112 18,118 13,115 8)'
|
'LINESTRING(117 22,112 18,118 13,115 8)'
|
||||||
),
|
),
|
||||||
b: new OpenLayers.Format.WKT().read(
|
b: wkt.read(
|
||||||
'POLYGON((110 20,120 20,120 10,110 10,110 20),(112 17,118 18,118 16,112 15,112 17))'
|
'POLYGON((110 20,120 20,120 10,110 10,110 20),(112 17,118 18,118 16,112 15,112 17))'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user