OpenLayers OpenLayers

Map Context

Define a JavaScript structure to represent the current map context. This will be translated into and extended WMC doc and can also be translated (with losses) to a short string for permalinks.

A MapContext control will be responsible for setting/getting the current state of the map. The context structure can be serialized with the JSON format and will be an acceptable input for the WMC format.

JS structure for WMC

The Javascript Structure of the Web Map Context can be defined in this space.

JSON WMC example


{
	"id":"Map3",
	"version":"1.1",
	"General":{
		"title":"Map3",
		"abstract":"Long description of my map",
		"KeywordList":"",
		"BoundingBox":{"minX":-281.25,"minY":-166.9921875,"maxX":281.25,"maxY":166.9921875,"srs":"EPSG:4326"},
		"Window":{"width":800,"height":475},
		
		"ContactInformation":{}
		
		"LogoURL":null,
		
		"DescriptionURL":null,
		
	},
	"LayerList":[
		{ 
		"name":"basic",
		"title":"basic",
		"abstract":"basic",
		"SRS":"null",
		"queryable":false,
		"resourceId":9,
		"hidden":false,
		"server":{ 
                         "service":"WMS", 
                         "title":"WMSServer", 
                         "onlineResource":{"href":"http://labs.metacarta.com/cgi-bin/mapserv?map=/www/labs/map/vmap0.map","type":"type1"}, 
                         "id":1, 
                         "version":"1.1.1"},
		"FormatList":[],
		"MetadataURL":[],
		"StyleTypeList":[],
		"transparent":null,
		},
		{ 
		"name":"coastline_01,coastline_02",
		"title":"coastline_01,coastline_02",
		"abstract":"coastline_01,coastline_02",
		"SRS":"null",
		"queryable":false,
		"resourceId":9,
		"hidden":false,
		"server":{ 
                         "service":"WMS", 
                         "title":"WMSServer", 
                         "onlineResource":{"href":"http://labs.metacarta.com/cgi-bin/mapserv?map=/www/labs/map/vmap0.map","type":"type1"}, 
                         "id":1, 
                         "version":"1.1.1"},"FormatList":[],
		"MetadataURL":[],
		"StyleTypeList":[],
		"transparent":true,
		},
	],
}

Structure

The WMC is mainly covering all OL needings to store the Map Object and then serialize/deserialize it for any scope. There are anyway some problems to solve in the structure. Let's see them step by step:

Basic Attributes
{
   	"id":"Map3",
	"version":"1.1",
}

General Attributes

General attributes are referred to Map object in general. Some of metadata available are maybe useless but can be integrated with future services support in OL (as CSW).

	"General":{
		"title":"",
		"abstract":"",
		"KeywordList":"",
		"BoundingBox":{
                               "minX":-180,
                               "minY":-166.9921875,
                               "maxX":281.25,
                               "maxY":166.9921875,
                               "srs":"EPSG:4326"},

		"Window":{
                               "width":800,
                               "height":475},
		
		"ContactInformation":{}
		
		"LogoURL":null,
		
		"DescriptionURL":null,
		
	},

Layer Attributes

Layers attributes are fundamental to our needing. Anyway something is lacking and something in not useful.

		{ 
		"name":"coastline_01,coastline_02",
		"title":"coastline_01,coastline_02",
		"abstract":"coastline_01,coastline_02",
		"SRS":"null",
		"queryable":false,
		"resourceId":9,
		"hidden":false,
		"server":{ 
                         "service":"WMS", 
                         "title":"WMSServer", 
                         "onlineResource":{"href":"http://labs.metacarta.com/cgi-bin/mapserv?map=/www/labs/map/vmap0.map","type":"type1"}, 
                         "id":1, 
                         "version":"1.1.1"},
		"FormatList":[],
		"MetadataURL":[],
		"StyleTypeList":[],
		"transparent":true,
		},