Revision 2676
Added by harris about 19 years ago
src/spatial/rendering/mapbuilder/lib/widget/GetFeatureInfo.js | ||
---|---|---|
39 | 39 |
this.doAction = function(objRef,targetNode) { |
40 | 40 |
if (objRef.enabled) { |
41 | 41 |
var selectedLayer=objRef.context.getParam("selectedLayer"); |
42 |
if (selectedLayer==null) { |
|
43 |
alert("Query layer not selected, select a queryable layer in the Legend."); |
|
42 |
if (selectedLayer==null) { // assume the metacat layer |
|
43 |
//alert("Query layer not selected, select a queryable layer in the Legend."); |
|
44 |
// objRef.xsl.setParameter("FORMAT", "text/html"); |
|
45 |
objRef.xsl.setParameter("queryLayer", "topp:metacat_testdata"); |
|
46 |
objRef.xsl.setParameter("xCoord", targetNode.evpl[0]); |
|
47 |
objRef.xsl.setParameter("yCoord", targetNode.evpl[1]); |
|
48 |
objRef.xsl.setParameter("infoFormat", objRef.infoFormat); |
|
49 |
objRef.xsl.setParameter("featureCount", "1"); |
|
50 |
|
|
51 |
urlNode=objRef.xsl.transformNodeToObject(objRef.context.doc); |
|
52 |
//alert(selectedLayer); |
|
53 |
url=urlNode.documentElement.firstChild.nodeValue; |
|
54 |
//alert("GetFeatureInfo .. : \n url="+url); |
|
55 |
|
|
56 |
if (objRef.infoFormat=="text/html"){ |
|
57 |
window.open(url,'queryWin','height=400,width=500,scrollbars=yes'); |
|
58 |
} |
|
59 |
|
|
44 | 60 |
} |
45 | 61 |
else { |
46 | 62 |
// objRef.xsl.setParameter("FORMAT", "text/html"); |
... | ... | |
51 | 67 |
objRef.xsl.setParameter("featureCount", "1"); |
52 | 68 |
|
53 | 69 |
urlNode=objRef.xsl.transformNodeToObject(objRef.context.doc); |
54 |
//alert(urlNode);
|
|
70 |
//alert(selectedLayer);
|
|
55 | 71 |
url=urlNode.documentElement.firstChild.nodeValue; |
56 | 72 |
//alert("GetFeatureInfo .. : \n url="+url); |
57 | 73 |
|
58 | 74 |
if (objRef.infoFormat=="text/html"){ |
59 |
window.open(url,'queryWin','height=200,width=300,scrollbars=yes');
|
|
75 |
window.open(url,'queryWin','height=400,width=500,scrollbars=yes');
|
|
60 | 76 |
} |
61 | 77 |
} |
62 | 78 |
} |
src/spatial/rendering/mapbuilder/index.html | ||
---|---|---|
1 | 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
2 | 2 |
|
3 |
<!-- |
|
4 |
Description: A Browser based Transactional Web Feature Server client |
|
5 |
based on javascript and XSL |
|
6 |
libraries from http://mapbuilder.sourceforge.net . |
|
7 |
Licence: GPL as per: http://www.gnu.org/copyleft/gpl.html |
|
8 | 3 |
|
9 |
$Id$ |
|
10 |
$Name$ |
|
11 |
--> |
|
12 |
|
|
13 | 4 |
<html> |
14 | 5 |
<head> |
15 |
<title>Metacat WFS-T Demo</title>
|
|
6 |
<title>Metacat Spatial Option Demo</title>
|
|
16 | 7 |
|
8 |
|
|
17 | 9 |
<link rel="stylesheet" href="../../../../style.css" type="text/css"> |
18 | 10 |
<link rel="stylesheet" href="../../lib/skin/default/html.css" |
19 | 11 |
type="text/css"> |
... | ... | |
30 | 22 |
--> |
31 | 23 |
<body onload="mbDoLoad()"> |
32 | 24 |
<!-- Layout mapbuilder widgets and HTML --> |
33 |
<h1><a href="http://mapbuilder.sourceforge.net">Map Builder</a> WFS-T |
|
34 |
Demo</h1> |
|
25 |
<h1>Metacat Spatial Option Demo </h1> |
|
35 | 26 |
|
36 | 27 |
<table border="0"> |
37 | 28 |
<tr> |
src/spatial/rendering/mapbuilder/metacat.xml | ||
---|---|---|
6 | 6 |
xsi:schemaLocation="http://www.opengis.net/context http://schemas.opengis.net/context/1.0.0/context.xsd"> |
7 | 7 |
|
8 | 8 |
<General> |
9 |
<Window width="500" height="250" />
|
|
9 |
<Window width="800" height="400" />
|
|
10 | 10 |
<BoundingBox SRS="EPSG:4326" minx="-180" miny="-90" maxx="180" |
11 | 11 |
maxy="90" /> |
12 | 12 |
<Title>metacat data</Title> |
... | ... | |
29 | 29 |
<Format current="1">image/gif</Format> |
30 | 30 |
</FormatList> |
31 | 31 |
</Layer> |
32 |
<Layer queryable="0" hidden="0"> |
|
33 |
<Server service="wms" version="1.1.0" title="wms"> |
|
34 |
<OnlineResource xlink:type="simple" xlink:href="http://atlas.gc.ca/cgi-bin/mapserv?map=/home/mapdata/aoc_v3/english/pb_world.map"/> |
|
35 |
</Server> |
|
36 |
|
|
37 |
<Name>land</Name> |
|
38 |
<Title>land area</Title> |
|
39 |
<SRS>EPSG:4326</SRS> |
|
40 |
<FormatList> |
|
41 |
<Format current="1">image/gif</Format> |
|
42 |
</FormatList> |
|
43 |
</Layer> |
|
44 |
|
|
32 | 45 |
<Layer queryable="1" hidden="0"> |
33 | 46 |
<Server service="OGC:WMS" version="1.1.1" |
34 | 47 |
title="metacat document data"> |
... | ... | |
41 | 54 |
<FormatList> |
42 | 55 |
<Format current="1">image/png</Format> |
43 | 56 |
</FormatList> |
57 |
|
|
58 |
|
|
59 |
<!-- |
|
60 |
|
|
61 |
<StyleList> |
|
62 |
<Style current="1"> |
|
63 |
<Name>0xb8d8f6</Name> |
|
64 |
<Title>0xb8d8f6</Title> |
|
65 |
<LegendURL width="16" height="16" format="image/gif"> |
|
66 |
<OnlineResource xlink:type="simple" xlink:href="../../../../wms?VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=topp:metacat_testdata&SPATIAL_TYPE=POLYGON&STYLE=0xb8d8f6&FORMAT=image%2Fgif&SIMPLE=TRUE"/> |
|
67 |
|
|
68 |
</LegendURL> |
|
69 |
</Style> |
|
70 |
</StyleList> |
|
71 |
--> |
|
72 |
|
|
44 | 73 |
</Layer> |
45 | 74 |
<!-- <Layer queryable="1" hidden="0"> |
46 | 75 |
<Server service="OGC:WMS" version="1.1.1" |
Also available in: Unified diff
Further work -- added additional layers, added the ability to query AOI. Almost have the js parseing the
correct metacat url, and sme style changes.