Project

General

Profile

« Previous | Next » 

Revision 3459

added:
-zoom on map with named locations for quick spatial searching based on selected park name (hooray javascript!)
-narrow search by selected park name
-cursor tracking in lat/lon
-alpha sort for left nav
-reference to fgdc in footer copy

View differences:

lib/style/skins/sanparks/SaeonLogin.jspx
89 89
			}
90 90
			if (!organizationScope.equals("%")) {
91 91
		</jsp:scriptlet>
92
			<jsp:expression>request.getParameter("organizationScope")</jsp:expression>
92
			<!-- set the map to use the correct scope -->
93
			<script type="text/javascript" >
94
				var dropDownTimer = null;
95
				
96
				//this syncs the map based on the input string location
97
				function setMapLocation(strLocation) {
98
				
99
					var mapFrameDocument = document.getElementById("mapFrame").contentDocument;
100
									
101
					//check if the dropdown is loaded in DOM
102
					if (mapFrameDocument.getElementsByName('locations').length == 0) {
103
						dropDownTimer = setTimeout("setMapLocation('" + strLocation + "')", 100);
104
						return false;
105
					}
106
					clearTimeout(dropDownTimer);
107
					
108
					var locationMenu = mapFrameDocument.getElementsByName('locations')[0];
109
					//alert("locationMenu=" + locationMenu);
110
					var locationOptions = locationMenu.options;
111
					//alert("locationOptions=" + locationOptions);
112
					//loop through the options to find the correct location based on input string
113
					for (var i=0; i &lt; locationOptions.length; i++) {
114
						if (locationOptions[i].text == strLocation) {
115
							//set as selected
116
							locationMenu.selectedIndex = i;
117
							break;
118
						}
119
					}
120
					//alert("Focusing on selected location: " + locationMenu.options[locationMenu.selectedIndex].text);
121
					
122
					//the onchange command from select object
123
					locationMenu.onchange();
124
					//mapFrameDocument.config.objects.locationsSelect.setAoi(locationMenu.options[locationMenu.selectedIndex].value,'mainMap');
125
				
126
				}
127
				
128
				//kick it off
129
				dropDownTimer = 
130
					setTimeout(
131
					"setMapLocation('<jsp:expression>organizationScope</jsp:expression>')",
132
					 100);
133
				
134
			</script>
135
			
136
			<jsp:expression>organizationScope</jsp:expression>
93 137
		<jsp:scriptlet>
94 138
			}
95 139
			else {
......
119 163
		would locate any phrase with the word herbivore embedded within it).
120 164
		</p>
121 165
			<input name="anyfield" value="" type="text" size="14" />
166
			<jsp:element name="input">
167
				<jsp:attribute name="name">placekey</jsp:attribute>
168
				<jsp:attribute name="type">hidden</jsp:attribute>
169
				<jsp:attribute name="value">
170
					<jsp:expression>organizationScope</jsp:expression>
171
				</jsp:attribute>
172
			</jsp:element>
122 173
			<input name="action" value="query" type="hidden" />  
123 174
			<input value="Search" type="submit" /> 
124 175
		
......
129 180
	<form name="browseform" method="post" action="../../../metacat"
130 181
		target="_top">
131 182
		<jsp:include page="SimpleSearchMetacatPostFields.html" /> 
132
		<input name="anyfield" type="hidden" value="%" /> 
183
		<input name="anyfield" type="hidden" value="%" />
133 184
		<jsp:element name="input">
185
			<jsp:attribute name="name">placekey</jsp:attribute>
186
			<jsp:attribute name="type">hidden</jsp:attribute>
187
			<jsp:attribute name="value">
188
				<jsp:expression>organizationScope</jsp:expression>
189
			</jsp:attribute>
190
		</jsp:element>
191
		<jsp:element name="input">
134 192
			<jsp:attribute name="name">sessionid</jsp:attribute>
135 193
			<jsp:attribute name="type">hidden</jsp:attribute>
136 194
			<jsp:attribute name="value">
......
285 343
	
286 344
	<!-- Map here --> 
287 345
	<br />
288
	<h3>Southern Africa</h3>
346
	<h3>Spatial Search</h3>
289 347
	
290 348
		<!-- map frame -->
291 349
        <script language="JavaScript">
lib/style/skins/sanparks/footer.jspx
11 11
		</head>
12 12
        <body class="footerContent">
13 13
            <p>
14
                This project is a cooperative effort of
15
                <a href="http://www.sanparks.org/">Kruger National Park (KNP)</a> and the 
14
                This project is a cooperative effort of the
15
                <a href="http://www.sanparks.org/">South African National Parks (SANParks)</a> and the 
16 16
                <a href="http://www.nceas.ucsb.edu">National Center for Ecological Analysis and Synthesis (NCEAS)</a>.
17 17
                The Data Repository is based on software developed by the 
18 18
                <a href="http://knb.ecoinformatics.org">Knowledge Network for Biocomplexity (KNB)</a>,
19 19
                and houses metadata that are compliant with 
20
                <a href="http://knb.ecoinformatics.org/software/eml/">Ecological Metadata Language (EML)</a>.
20
                <a href="http://knb.ecoinformatics.org/software/eml/">Ecological Metadata Language (EML)</a>
21
                and the <a href="http://www.fgdc.gov/metadata">Federal Geographic Data Committee (FGDC)</a> specification.
21 22
                Other sites contributing to the KNB repository include:
22 23
                <ul>
23 24
                    <li>
lib/style/skins/sanparks/leftnav.jsp
28 28
									<a href="#" onclick="orgForm.organizationScope.value='SANParks, South Africa';orgForm.submit();">SANParks</a>
29 29
									<ul class="level-2">
30 30
										<li><a href="#" onclick="orgForm.organizationScope.value='SANParks, South Africa';orgForm.submit();">All</a></li>
31
										<li><a href="#" onclick="orgForm.organizationScope.value='Kruger National Park, South Africa';orgForm.submit();">Kruger National Park</a></li>
32 31
										<li><a href="#" onclick="orgForm.organizationScope.value='Addo National Park, South Africa';orgForm.submit();">Addo National Park</a></li>
33
										<li><a href="#" onclick="orgForm.organizationScope.value='Mapungubwe National Park, South Africa';orgForm.submit();">Mapungubwe National Park</a></li>
34
										<li><a href="#" onclick="orgForm.organizationScope.value='Marakele National Park, South Africa';orgForm.submit();">Marakele National Park</a></li>
35
										<li><a href="#" onclick="orgForm.organizationScope.value='Golden Gate National Park, South Africa';orgForm.submit();">Golden Gate National Park</a></li>
36
										<li><a href="#" onclick="orgForm.organizationScope.value='Karoo National Park, South Africa';orgForm.submit();">Karoo National Park</a></li>
37
										<li><a href="#" onclick="orgForm.organizationScope.value='Richtersveld National Park, South Africa';orgForm.submit();">Richtersveld National Park</a></li>
38
										<li><a href="#" onclick="orgForm.organizationScope.value='Wilderness National Park, South Africa';orgForm.submit();">Wilderness National Park</a></li>
39 32
										<li><a href="#" onclick="orgForm.organizationScope.value='Agulhas National Park, South Africa';orgForm.submit();">Agulhas National Park</a></li>
33
										<li><a href="#" onclick="orgForm.organizationScope.value='Augrabies Falls National Park, South Africa';orgForm.submit();">Augrabies Falls National Park</a></li>
40 34
										<li><a href="#" onclick="orgForm.organizationScope.value='Bontebok National Park, South Africa';orgForm.submit();">Bontebok National Park</a></li>
41 35
										<li><a href="#" onclick="orgForm.organizationScope.value='Camdeboo National Park, South Africa';orgForm.submit();">Camdeboo National Park</a></li>
36
										<li><a href="#" onclick="orgForm.organizationScope.value='Golden Gate National Park, South Africa';orgForm.submit();">Golden Gate National Park</a></li>
37
										<li><a href="#" onclick="orgForm.organizationScope.value='Karoo National Park, South Africa';orgForm.submit();">Karoo National Park</a></li>
42 38
										<li><a href="#" onclick="orgForm.organizationScope.value='Knysna National Lake Area, South Africa';orgForm.submit();">Knysna National Lake Area</a></li>
39
										<li><a href="#" onclick="orgForm.organizationScope.value='Kruger National Park, South Africa';orgForm.submit();">Kruger National Park</a></li>
40
										<li><a href="#" onclick="orgForm.organizationScope.value='Mapungubwe National Park, South Africa';orgForm.submit();">Mapungubwe National Park</a></li>
41
										<li><a href="#" onclick="orgForm.organizationScope.value='Marakele National Park, South Africa';orgForm.submit();">Marakele National Park</a></li>
43 42
										<li><a href="#" onclick="orgForm.organizationScope.value='Mokala National Park, South Africa';orgForm.submit();">Mokala National Park</a></li>
44 43
										<li><a href="#" onclick="orgForm.organizationScope.value='Mountain Zebra National Park, South Africa';orgForm.submit();">Mountain Zebra National Park</a></li>
45 44
										<li><a href="#" onclick="orgForm.organizationScope.value='Namaqua National Park, South Africa';orgForm.submit();">Namaqua National Park</a></li>
45
										<li><a href="#" onclick="orgForm.organizationScope.value='Richtersveld National Park, South Africa';orgForm.submit();">Richtersveld National Park</a></li>
46 46
										<li><a href="#" onclick="orgForm.organizationScope.value='Table Mountain National Park, South Africa';orgForm.submit();">Table Mountain National Park</a></li>
47 47
										<li><a href="#" onclick="orgForm.organizationScope.value='Tankwa Karoo National Park, South Africa';orgForm.submit();">Tankwa Karoo National Park</a></li>
48 48
										<li><a href="#" onclick="orgForm.organizationScope.value='Tsitsikamma National Park, South Africa';orgForm.submit();">Tsitsikamma National Park</a></li>
49 49
										<li><a href="#" onclick="orgForm.organizationScope.value='West Coast National Park, South Africa';orgForm.submit();">West Coast National Park</a></li>
50
										<li><a href="#" onclick="orgForm.organizationScope.value='Augrabies Falls National Park, South Africa';orgForm.submit();">Augrabies Falls National Park</a></li>
50
										<li><a href="#" onclick="orgForm.organizationScope.value='Wilderness National Park, South Africa';orgForm.submit();">Wilderness National Park</a></li>
51 51
									</ul>
52 52
								</li>
53 53
								<li>
54 54
									<a href="#" onclick="orgForm.organizationScope.value='SAEON, South Africa';orgForm.submit();">SAEON</a>
55 55
									<ul class="level-2">
56 56
										<li><a href="#" onclick="orgForm.organizationScope.value='SAEON, South Africa';orgForm.submit();">All</a></li>
57
										<li><a href="#" onclick="orgForm.organizationScope.value='Elwandle SAEON Node, South Africa';orgForm.submit();">Elwandle SAEON Node</a></li>										
57 58
										<li><a href="#" onclick="orgForm.organizationScope.value='Ndlovu SAEON Node, South Africa';orgForm.submit();">Ndlovu SAEON Node</a></li>
58
										<li><a href="#" onclick="orgForm.organizationScope.value='Elwandle SAEON Node, South Africa';orgForm.submit();">Elwandle SAEON Node</a></li>
59 59
									</ul>
60 60
								</li>
61 61
							</ul>		
lib/style/skins/sanparks/spatial/pma.html
44 44
            arrReturnElements.push(oElement);
45 45
        }   
46 46
    }
47
    return (arrReturnElements)
47
    return (arrReturnElements)    
48 48
}
49 49

  
50 50
</script>
51

  
51 52
</head>
52 53
<!--
53 54
 <body onload="document.location='/wms/GetCapabilities'">
......
61 62
	    <td valign="top">
62 63
			<table border="0" style="border: 1px solid #525d76;">
63 64
			
64
				<tr>
65
				<tr valign="top">
65 66
					
66 67
					<td>
67 68
						<div id="mainMapPane" style="background-color:white;" />
......
70 71
							<img src="../../../../spatial/mapbuilder/lib/skin/default/images/Loading.gif"/>
71 72
							</p>
72 73
						</div>
73
						
74 74
					</td>
75 75
					
76 76
					<td>
77 77
						 
78 78
						<table border="0">
79
							<tr> <td id="locatorMap" style="display:none"/> </tr>
80
							<tr> <td id="mainButtonBar" />  </tr>
81
							<tr> <td id="legend" valign="top"/> </tr> 
82
							<tr> <td colspan="3" id="featureList" /> </tr>
79
							<tr>
80
								<td id="locatorMap" style="display:none"/>
81
							</tr>
82
							<tr>
83
								<td id="mainButtonBar" />
84
							</tr>
85
							<tr>
86
								<td id="cursorTrack" />
87
							</tr>
88
							<tr>
89
								<td id="legend" valign="top"/>
90
							</tr> 
91
							<tr>
92
								<td id="featureList" />
93
							</tr>
83 94
						</table>
84
						
85 95
					</td>
86 96
					
87 97
				</tr>
88 98
				
99
				<tr>
100
					<td colspan="2" align="center" id="locationsSelect" />
101
				</tr>
102
				
89 103
			</table>
90 104
		</td>
91 105
	</tr>
lib/style/skins/sanparks/spatial/africa_frame_config.xml
33 33
          <crossSize>15</crossSize>
34 34
          <mapContainerId>mainMapContainer</mapContainerId>
35 35
        </AoiBoxWZ>
36
        <!-- <CursorTrack id="cursorTrack">
36
        <CursorTrack id="cursorTrack">
37 37
          <mouseHandler>mainMap</mouseHandler>
38
        </CursorTrack> -->
38
          <showDMS>false</showDMS>
39
          <showLatLong>true</showLatLong>
40
        </CursorTrack>
39 41
        <Legend id="legend">
40 42
        </Legend>
41 43
        <MapScaleText id="mapScaleText">
......
75 77
        </ZoomToAoi>
76 78
      </tools>
77 79
    </Context>
80
    
81
    <Model id="locations">
82
	    <defaultModelUrl>./named_locations.xml</defaultModelUrl>
83
	    <widgets>
84
	        <Locations id="locationsSelect">
85
	            <targetModel>mainMap</targetModel>
86
	        </Locations>
87
	    </widgets>
88
	    <tools>
89
	        <ZoomToAoi id="locationsZoomToAoi">
90
	            <targetModel>mainMap</targetModel>
91
	        </ZoomToAoi>
92
	    </tools>
93
	</Model>
78 94

  
79 95
    <Transaction id="transaction">
80 96
      <widgets>
lib/style/skins/sanparks/spatial/africa_frame_model.xml
56 56
        <Format current="1">image/gif</Format>
57 57
      </FormatList>
58 58
    </Layer>
59
   
60
   <!--
61
    <Layer queryable="0" hidden="1">
62
      <Server service="OGC:WMS" version="1.1.1"
63
      title="kruger boundary">
64
        <OnlineResource xlink:type="simple" xlink:href="../../../../wms" />
65
      </Server>
66
      <Name>knp:SOILS_VENTER</Name>
67
      <Title>Kruger soils</Title>
68
      <SRS>EPSG:4326</SRS>
69
      <FormatList>
70
        <Format current="1">image/png</Format>
71
      </FormatList>
72
    </Layer>
73

  
74
    <Layer queryable="0" hidden="1">
75
      <Server service="OGC:WMS" version="1.1.1"
76
      title="kruger boundary">
77
        <OnlineResource xlink:type="simple" xlink:href="../../../../wms" />
78
      </Server>
79
      <Name>knp:INFRA_ROADSPUBLIC_VIEW</Name>
80
      <Title>Kruger Park roads</Title>
81
      <SRS>EPSG:4326</SRS>
82
      <FormatList>
83
        <Format current="1">image/png</Format>
84
      </FormatList>
85
    </Layer>
86
	
87
    <Layer queryable="0" hidden="1">
88
      <Server service="OGC:WMS" version="1.1.1"
89
      title="kruger boundary">
90
        <OnlineResource xlink:type="simple" xlink:href="../../../../wms" />
91
      </Server>
92
      <Name>knp:BNDRY_BUSINESSUNITS</Name>
93
      <Title>Kruger Park business units</Title>
94
      <SRS>EPSG:4326</SRS>
95
      <FormatList>
96
        <Format current="1">image/png</Format>
97
      </FormatList>
98
    </Layer>
99
   
100
    
101
    <Layer queryable="0" hidden="1">
102
      <Server service="OGC:WMS" version="1.1.1"
103
      title="kruger boundary">
104
        <OnlineResource xlink:type="simple" xlink:href="../../../../wms" />
105
      </Server>
106
      <Name>knp:BNDRY_KRUGERNP</Name>
107
      <Title>Kruger Park boundaries</Title>
108
      <SRS>EPSG:4326</SRS>
109
      <FormatList>
110
        <Format current="1">image/png</Format>
111
      </FormatList>
112
    </Layer>
113
	-->
114
	
59
   	
115 60
    <Layer queryable="0" hidden="0">
116 61
      <Server service="OGC:WMS" version="1.1.1"
117 62
      title="DatasetBounds">
lib/style/skins/sanparks/spatial/named_locations.xml
1
<?xml version="1.0" encoding="utf-8" standalone="no"?>
2
<!-- $Id$ -->
3
<QuickviewPresetResultSet version="1.0.0"  xmlns="http://mapbuilder.sourceforge.net/mapbuilder" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mapbuilder.sourceforge.net/mapbuilder ../../../lib/schemas/locations.xsd">
4
        <gml:description>This is the CMB preset zoom document</gml:description>
5
        <gml:name>CMB:QuickViewPreset</gml:name>
6
        <gml:boundedBy>
7
                <gml:Null>missing</gml:Null>
8
        </gml:boundedBy>
9

  
10
        <gml:featureMember>
11
                <locationDef>
12
                        <gml:name> Select a Location</gml:name>
13
                        <spatialKeyword>
14
                                <gml:location>
15
                                        <gml:Envelope srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
16
                                                <gml:coordinates>16.5,-35 32.5,-22</gml:coordinates>
17
                                                <!-- <BoundingBox SRS="EPSG:4326" miny = "-35" maxy = "-22" maxx = "32.5" minx = "16.5"  />-->
18
                                        </gml:Envelope>
19
                                </gml:location>
20
                        </spatialKeyword>
21
                </locationDef>
22
        </gml:featureMember>
23

  
24
        <gml:featureMember>
25
                <locationDef>
26
                        <gml:name>Kruger National Park, South Africa</gml:name>
27
                        <spatialKeyword>
28
                                <gml:location>
29
                                        <gml:Envelope srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
30
                                                <gml:coordinates>31,-26 32,-22</gml:coordinates>
31
                                                <!-- <gml:coordinates>LL:lon,lat UR:lon,lat</gml:coordinates> -->
32
                                        </gml:Envelope>
33
                                </gml:location>
34
                        </spatialKeyword>
35
                </locationDef>
36
        </gml:featureMember>
37

  
38
        <gml:featureMember>
39
                <locationDef>
40
                        <gml:name>Marakele National Park, South Africa</gml:name>
41
                        <spatialKeyword>
42
                                <gml:location>
43
                                        <gml:Envelope srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
44
                                                <gml:coordinates>27.4,-24.6 27.8,-24.2</gml:coordinates>
45
                                        </gml:Envelope>
46
                                </gml:location>
47
                        </spatialKeyword>
48
                </locationDef>
49
        </gml:featureMember>
50

  
51
</QuickviewPresetResultSet>
0 52

  
lib/style/skins/sanparks/sanparks.css
102 102

  
103 103
.mapFrame { 
104 104
    /*height: 59em;*/
105
    height: 300px;
105
    height: 320px;
106 106
    width: 600px;
107 107
	vertical-align: top;
108 108
	background: #FFFFFF;

Also available in: Unified diff