--- /dev/null
+<html xmlns="http://www.w3.org/1999/xhtml" >\r
+<head>\r
+ <title>Geoplatform MNCN - Map viewer (prototype)</title>\r
+ <link rel="stylesheet" href="theme/default/style.css" type="text/css" />\r
+ <link rel="stylesheet" href="style.css" type="text/css" />\r
+ <script src="../mapviewer/OpenLayers.js"></script>\r
+ <script src="jquery.js"></script>\r
+ <script type="text/javascript">\r
+\r
+ var map,layer;\r
+ \r
+ function init()\r
+ {\r
+\r
+ map = new OpenLayers.Map('map');\r
+ var base_layer = new OpenLayers.Layer.WMS( \r
+ "OpenLayers WMS",\r
+ "http://labs.metacarta.com/wms/vmap0",\r
+ {layers: 'basic'}, \r
+ {\r
+ maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),\r
+ isBaseLayer: true,\r
+ displayInLayerSwitcher: false \r
+ }\r
+ );\r
+ \r
+ edit_tdwg4 = new OpenLayers.Layer.WMS.Untiled( "EDIT TDWG4 layer","http://193.190.223.53:8080/geoserver/wms",{layers:"topp:tdwg_level_4",transparent:"true"});\r
+map.addLayers([base_layer,edit_tdwg4]);\r
+\r
+layer = new OpenLayers.Layer.WMS.Untiled("point layer", "http://193.190.223.53:8080/geoserver/wms", {layers: "rest_points", transparent:"true", format:"image/png"}, {maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90), isBaseLayer: false, displayInLayerSwitcher: false});\r
+ \r
+ foo=function(data){\r
+ if(!data){\r
+ console.log("no data");\r
+ }else{\r
+\r
+ layer.params.SLD = 'http://taxonomicindex.africamuseum.be/synthesys/www/v1/sld/'+ data.points_sld;\r
+ if (map.layer==null)\r
+ {\r
+ map.addLayer(layer);\r
+ } legend_url="http://193.190.223.53:8080/geoserver/wms/GetLegendGraphic?SERVICE=WMS&VERSION=1.1.1&format=image/png&TRANSPARENT=TRUE&WIDTH=64&HEIGHT=36&";\r
+ legend_url+="layer=rest_points&LEGEND_OPTIONS=forceLabels:on;fontStyle:italic;fontSize:12&SLD=http://taxonomicindex.africamuseum.be/synthesys/www/v1/sld/"+data.points_sld;\r
+\r
+ $("#legend").attr('src',legend_url).width('100');\r
+ $("div[id='div_legend']").css({'top':-($("#map").height()-30),'left':$("#map").width()-130});\r
+ var bounds=new OpenLayers.Bounds.fromString(data.bbox);\r
+ var zoom=map.getZoomForExtent(bounds);\r
+ center=bounds.getCenterLonLat();\r
+maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90)\r
+ map.setCenter(center,map.getZoomForExtent(bounds));\r
+ }\r
+ }\r
+\r
+ \r
+ \r
+ var bbox='-180, -90, 180, 90';\r
+\r
+ var bounds=new OpenLayers.Bounds.fromString(bbox);\r
+ var zoom=map.getZoomForExtent(bounds);\r
+ center=bounds.getCenterLonLat();\r
+\r
+ map.setCenter(center,map.getZoomForExtent(bounds));\r
+ \r
+ } \r
+ </script>\r
+ <script>\r
+\r
+ $(document).ready(function(){\r
+\r
+$('#url_form :button').click(function() { \r
+rest_url=$('#url_form option:selected').val();\r
+ $.ajax({url: rest_url, dataType: "script",type: "GET", cache: true, callback: foo, data:null});\r
+\r
+ });\r
+}) \r
+ \r
+ \r
+ \r
+ </script> \r
+ </head>\r
+ <body onload="init()">\r
+ <div> Testing REST URL callback</div>\r
+ <form id="url_form" action="#">\r
+ <select>\r
+ <option value="http://taxonomicindex.africamuseum.be/edit_wp5/v1/points_new.php?od=1:0,0|-5,30||2:44.19195,7.44663|-20,30&os=2:s/ed1d8b/30/myspecie|1:c/8B0000/10/Histopona%20italica&image=false">url 1</option>\r
+ <option value="http://taxonomicindex.africamuseum.be/edit_wp5/v1/points_new.php?od=1:71,14||2:80,28|82,36&os=2:s/ed1d8b/40/myspecie 1|1:c/8B0000/10/myspecie 2&image=false">url 2</option>\r
+ </select>\r
+ <input type="button" name="search" value="submit" id="search"/> \r
+ </form>\r
+ <div id="map" class="smallmap"></div>\r
+ <div id="paths"></div>\r
+ <div id="div_legend" style="position:relative;z-index:30000"><img style="background-color:white" id="legend" style="width:0;" src=''/></div>\r
+\r
+ </body>\r
+</html>
\ No newline at end of file