Project

General

Profile

« Previous | Next » 

Revision 5934

remove sanparks boundaries from the default map, but allow them to be added as an additional layer from the saeon/sanparks skin.
use css to style the spatial query search widget control
http://bugzilla.ecoinformatics.org/show_bug.cgi?id=2188

View differences:

lib/style/skins/sanparks/spatial/map.jsp
36 36
<!-- *********************** START Map ************************* -->
37 37
<html>
38 38
  <head>
39
    <style type="text/css">
40
        body { background-color:white; }
41
        #map {
42
            width: 780px;
43
            height: 420px;
44
            border: 1px solid #cccccc;
45
        }
46
    </style>
39
    <link rel="stylesheet" type="text/css" href="<%=STYLE_COMMON_URL%>/spatial/map.css" />
47 40
    <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
48 41
    <script src="<%=STYLE_COMMON_URL%>/spatial/map.js"></script>
49 42
    <script type="text/javascript">
50 43
        function init() {	
44
            // set the bounds for this map
51 45
            var bounds = new OpenLayers.Bounds(16.5,-35,32.5,-22);
46
            // include the sanparks layer
47
            var sanparks_boundaries = new OpenLayers.Layer.WMS(
48
                    "SANParks Boundaries",
49
            		"<%=GEOSERVER_URL%>" + "/wms",
50
                    {layers: "SANParks_Boundaries_gcs_wgs84",
51
                     transparent: "true", format: "image/gif"} );
52 52
            // make the map for this skin
53
            initMap("<%=GEOSERVER_URL%>", "<%=SERVLET_URL%>", "saeon", bounds);
53
            initMap("<%=GEOSERVER_URL%>", "<%=SERVLET_URL%>", "sanparks", bounds, [sanparks_boundaries]);
54 54
        }
55 55
    </script>
56 56
  </head>
lib/style/skins/saeon/spatial/map.jsp
36 36
<!-- *********************** START Map ************************* -->
37 37
<html>
38 38
  <head>
39
    <style type="text/css">
40
        body { background-color:white; }
41
        #map {
42
            width: 780px;
43
            height: 420px;
44
            border: 1px solid #cccccc;
45
        }
46
    </style>
39
    <link rel="stylesheet" type="text/css" href="<%=STYLE_COMMON_URL%>/spatial/map.css" />
47 40
    <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
48 41
    <script src="<%=STYLE_COMMON_URL%>/spatial/map.js"></script>
49 42
    <script type="text/javascript">
50 43
        function init() {	
51 44
            var bounds = new OpenLayers.Bounds(16.5,-35,32.5,-22);
45
         	// include the sanparks layer
46
            var sanparks_boundaries = new OpenLayers.Layer.WMS(
47
                    "SANParks Boundaries",
48
            		"<%=GEOSERVER_URL%>" + "/wms",
49
                    {layers: "SANParks_Boundaries_gcs_wgs84",
50
                     transparent: "true", format: "image/gif"} );
52 51
            // make the map for this skin
53
            initMap("<%=GEOSERVER_URL%>", "<%=SERVLET_URL%>", "saeon", bounds);
52
            initMap("<%=GEOSERVER_URL%>", "<%=SERVLET_URL%>", "saeon", bounds, [sanparks_boundaries]);
54 53
        }
55 54
    </script>
56 55
  </head>
lib/style/common/spatial/map.css
1
body {
2
	background-color: white;
3
}
4

  
5
#map {
6
	width: 760px;
7
	height: 380px;
8
	border: 1px solid #cccccc;
9
}
10

  
11
.olControlNavToolbar .spatialQueryItemActive {
12
	background-image: url("metacat-query-on.png");
13
	background-repeat: no-repeat;
14
}
15

  
16
.olControlNavToolbar .spatialQueryItemInactive {
17
	background-image: url("metacat-query-off.png");
18
	background-repeat: no-repeat;
19
}
0 20

  
lib/style/common/spatial/map.js
2 2
var map;
3 3
var control;
4 4

  
5
function initMap(GEOSERVER_URL, SERVLET_URL, qformat, bounds) {
5
function initMap(GEOSERVER_URL, SERVLET_URL, qformat, bounds, additionalLayers) {
6 6
	if (!bounds) {
7 7
		bounds = new OpenLayers.Bounds(-180,-90,180,90);
8 8
	}
......
23 23
        {layers: "world_borders",
24 24
         format: "image/jpeg"} );
25 25

  
26
    var sanparks_boundaries = new OpenLayers.Layer.WMS( "SANParks Boundaries",
27
    		GEOSERVER_URL + "/wms",
28
            {layers: "SANParks_Boundaries_gcs_wgs84",
29
             transparent: "true", format: "image/gif"} );
30

  
31
    /* 
32
     *   Other possible WMS base layers to include
33
     */
34

  
35 26
    var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
36 27
        "http://labs.metacarta.com/wms/vmap0",
37 28
        {layers: 'basic'} );
......
44 35
        "http://www2.demis.nl/WMS/wms.asp?wms=WorldMap",
45 36
        {layers: 'Bathymetry,Countries,Topography,Hillshading,Coastlines,Waterbodies,Inundated,Rivers,Streams,Builtup+areas,Railroads,Highways,Roads,Trails,Borders,Cities,Settlements,Airports'} );
46 37

  
47
    jpl_wms.setVisibility(false);
48
    ol_wms.setVisibility(false);
49
    demis.setVisibility(false);
38
	map.addLayers([demis, jpl_wms, ol_wms, world_borders, metacat_points, metacat_bounds]);	
50 39

  
51
	map.addLayers([demis, sanparks_boundaries, jpl_wms, ol_wms, world_borders, metacat_points, metacat_bounds]);	
52

  
40
	// perhaps a skin has added more layers
41
	if (additionalLayers) {
42
		map.addLayers(additionalLayers);
43
	}
44
	
53 45
    // get the drag box event
54 46
	//control = new OpenLayers.Control();
55 47
	control = new OpenLayers.Control({title: "Metacat spatial query", displayClass: "spatialQuery"});
lib/style/common/spatial/map.jsp
37 37
<!-- *********************** START Map ************************* -->
38 38
<html>
39 39
  <head>
40
    <style type="text/css">
41
        body { background-color:white; }
42
        #map {
43
            width: 760px;
44
            height: 380px;
45
            border: 1px solid #cccccc;
46
        }
47
        .olControlNavToolbar .spatialQueryItemActive { 
48
        	background-image: url("<%=STYLE_COMMON_URL%>/spatial/metacat-query-on.png");
49
		  	background-repeat: no-repeat;
50
		}
51
		.olControlNavToolbar .spatialQueryItemInactive { 
52
        	background-image: url("<%=STYLE_COMMON_URL%>/spatial/metacat-query-off.png");
53
		  	background-repeat: no-repeat;
54
		}
55
		
56

  
57
    </style>
40
	<link rel="stylesheet" type="text/css" href="<%=STYLE_COMMON_URL%>/spatial/map.css" />
58 41
    <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
59 42
    <script src="<%=STYLE_COMMON_URL%>/spatial/map.js"></script>
60 43
    <script type="text/javascript">

Also available in: Unified diff