Changes between Version 1 and Version 2 of ZooWebSite/Demo/CGALJs


Ignore:
Timestamp:
Feb 15, 2011, 2:07:17 PM (14 years ago)
Author:
djay
Comment:

Have to attach the cgal-demo.js to this page.

Legend:

Unmodified
Added
Removed
Modified
  • ZooWebSite/Demo/CGALJs

    v1 v2  
    77  <script type="text/javascript" src="/openlayers/lib/OpenLayers.js"></script>
    88  <script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script>
    9   <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    10 <script  type="text/javascript">
    11         var map, SubwayStops, layer;
    12 
    13         function init(){
    14             OpenLayers.ProxyHost= "../cgi-bin/proxy_zoo.cgi?url=";
    15             map = new OpenLayers.Map('map', {
    16                 controls: [
    17                     new OpenLayers.Control.PanZoom(),
    18                     new OpenLayers.Control.Permalink(),
    19                     new OpenLayers.Control.LayerSwitcher(),
    20                     new OpenLayers.Control.Navigation()
    21                 ],
    22                 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
    23                 maxResolution: 156543.0399,
    24                 numZoomLevels: 19,
    25                 units: "m",
    26                 projection: new OpenLayers.Projection("EPSG:900913"),
    27                 displayProjection: new OpenLayers.Projection("EPSG:4326")
    28             });
    29            
    30             var layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
    31             map.addLayer(layerMapnik);
    32 
    33             layer = new OpenLayers.Layer.Vector("Voronoi",{
    34                 styleMap: new OpenLayers.StyleMap({
    35                   strokeColor: "#000000",
    36                   strokeWidth: 1
    37                 })
    38             });
    39             map.addLayer(layer);
    40            
    41             SubwayStops = new OpenLayers.Layer.GML("Subway stops",
    42                 "http://www.zoo-project.org/data-srtm/stations.gml", {
    43                   format: OpenLayers.Format.GML,
    44                   styleMap: new OpenLayers.StyleMap({
    45                     pointRadius: 3,
    46                     fillColor: "#ee2200",
    47                     fillOpacity: 1,
    48                     strokeColor: "#ee9900",
    49                     strokeWidth: 1
    50                   }),
    51                   visibility: true
    52             });
    53             map.addLayer(SubwayStops);
    54 
    55             map.zoomToExtent(new OpenLayers.Bounds(240047.557702813,6234682.54296228,281304.353234602,6267347.78149257),true);
    56         }
    57         function cgalProcessing(aProcess) {
    58           var url = '/zoo/?request=Execute&service=WPS&version=1.0.0&';
    59           if (aProcess == 'voronoi')
    60             url += 'Identifier=Voronoi&DataInputs=InputPoints=Reference@xlink:href=';
    61           else
    62                 url += 'Identifier='+aProcess+'&DataInputs=InputPoints=Reference@xlink:href=';
    63 
    64           var xlink = SubwayStops.url;
    65           url += encodeURIComponent(xlink);
    66           url += '&RawDataOutput=Result';
    67 
    68           var request = new OpenLayers.Request.XMLHttpRequest();
    69           request.open('GET',url,true);
    70           request.onreadystatechange = function() {
    71             if(request.readyState == OpenLayers.Request.XMLHttpRequest.DONE) {
    72               var GeoJSON = new OpenLayers.Format.GeoJSON();
    73               var features = GeoJSON.read(request.responseText);
    74               layer.removeFeatures(layer.features);
    75               layer.addFeatures(features);
    76             }
    77           }
    78           request.send();
    79         }
    80 </script>
     9  <script type="text/javascript" src="/ogr/js/jquery-1.3.2.js"></script>
     10  <script  type="text/javascript" src="cgal-demo.js"></script>
    8111
    8212}}}

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png