Changes between Version 4 and Version 5 of ZooWebSite/ZOOAPI/Examples
- Timestamp:
- Nov 10, 2010, 1:23:20 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ZooWebSite/ZOOAPI/Examples
v4 v5 1 1 = ZOO API Examples = 2 2 3 Documentation is under construction 3 In this page you can find some small examples on how to use the JavaScript ZOO-API on the server side. 4 4 5 The ZOO-API contains many classes and functions for which you can find description [wiki:ZooWebSite/ZOOAPI/Classes here]. 5 6 6 == ZOO API Classes==7 == ZOO.Process example of use == 7 8 8 ZOO.Bounds 9 10 ZOO.Projection 11 12 ZOO.Format 13 14 ZOO.Format.WKT 15 16 ZOO.Format.JSON 17 18 ZOO.Format.GeoJSON 19 20 ZOO.Format.KML 21 22 ZOO.Format.GML 23 24 ZOO.Feature 25 26 ZOO.Geometry 27 28 ZOO.Geometry.Point 29 30 ZOO.Geometry.Surface 31 32 ZOO.Geometry.MultiPoint 33 34 ZOO.Geometry.Curve 35 36 ZOO.Geometry.LineString 37 38 ZOO.Geometry.LinearRing 39 40 ZOO.Geometry.MultiLineString 41 42 ZOO.Geometry.MultiPolygon 43 44 ZOO.Process 45 9 {{{ 10 #!c 11 var myProcess = new ZOO.Process('http://localhost/cgi-bin-new1/zoo_loader_new1.cgi','Boundary'); 12 var myInputs = { InputPolygon: {value: "[[[-106.993853,35.998758],[-107.407233,35.997524],[-107.430525,35.997726],[-107.4824,35.99878],[-108.37013,35.999472],[-109.043633,35.996652],[-109.096265,35.997817],[-109.148763,36.001751],[-109.200981,36.008442],[-109.252775,36.017871],[-109.304,36.030014],[-109.354516,36.044835],[-106.468201,35.991497],[-106.855511,35.989504],[-106.90933,35.990676],[-106.963008,35.994743],[-106.993853,35.998758]]]",encoding: "application/json"} }; 13 var myExecuteResult=myProcess.Execute(myInputs); 14 var wps = new ZOO.Format.WPS(); 15 var myOutputs = wps.read(myExecuteResult); 16 return {result: ZOO.SERVICE_SUCCEEDED, outputs: [ {name:"Result", value: myOutputs} ] }; 17 }}}