Nicer design for the WMS preview
This commit is contained in:
parent
32a180f39c
commit
0cf2c7e7ac
|
@ -152,11 +152,10 @@ class ViewController(BaseController):
|
||||||
|
|
||||||
def map_view(self,id):
|
def map_view(self,id):
|
||||||
#check if package exists
|
#check if package exists
|
||||||
pkg = Package.get(id)
|
c.pkg = Package.get(id)
|
||||||
if pkg is None:
|
if c.pkg is None:
|
||||||
abort(404, 'Package not found')
|
abort(404, 'Package not found')
|
||||||
|
|
||||||
c.url = pkg.url
|
|
||||||
return render('ckanext/harvest/map.html')
|
return render('ckanext/harvest/map.html')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
MAP_VIEW="""
|
MAP_VIEW="""
|
||||||
<div class="mapview">
|
<div class="mapview">
|
||||||
<a href="/package/%(name)s/map">View in map</a>
|
<a href="/package/%(name)s/map">View available WMS layers »</a>
|
||||||
</div>
|
</div>
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -144,7 +144,7 @@ CKAN.MapViewer = function($){
|
||||||
|
|
||||||
|
|
||||||
OpenLayers.ImgPath = "/ckanext/harvest/js/openlayers/img/";
|
OpenLayers.ImgPath = "/ckanext/harvest/js/openlayers/img/";
|
||||||
OpenLayers.Lang.en.overlays = "Layers";
|
OpenLayers.Lang.en.overlays = "Available Layers:";
|
||||||
|
|
||||||
OpenLayers.Control.CustomMousePosition = OpenLayers.Class(OpenLayers.Control.MousePosition,{
|
OpenLayers.Control.CustomMousePosition = OpenLayers.Class(OpenLayers.Control.MousePosition,{
|
||||||
formatOutput: function(lonLat) {
|
formatOutput: function(lonLat) {
|
||||||
|
|
|
@ -7,3 +7,13 @@
|
||||||
display: inline;
|
display: inline;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* OpenLayers */
|
||||||
|
.dataLbl{
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataLayersDiv span{
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||||
py:strip="">
|
py:strip="">
|
||||||
|
|
||||||
<py:def function="page_title">WMS preview</py:def>
|
<py:def function="page_title">${c.pkg.title or c.pkg.name} - WMS preview</py:def>
|
||||||
|
|
||||||
<py:def function="optional_head">
|
<py:def function="optional_head">
|
||||||
<link type="text/css" rel="stylesheet" media="all" href="/ckanext/harvest/mapviewer.css" />
|
<link type="text/css" rel="stylesheet" media="all" href="/ckanext/harvest/mapviewer.css" />
|
||||||
|
@ -13,16 +13,34 @@
|
||||||
|
|
||||||
<div py:match="content">
|
<div py:match="content">
|
||||||
<div class="map-view-content">
|
<div class="map-view-content">
|
||||||
<h2>WMS preview</h2>
|
<h2 class="head">
|
||||||
|
${c.pkg.title}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<!-- Source URL -->
|
||||||
|
<div class="url" py:if="c.pkg.url">
|
||||||
|
<p>
|
||||||
|
Source: <a href="${c.pkg.url}" target="_blank">${c.pkg.url}</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<a
|
||||||
|
href="${url(controller='package', action='read', id=c.pkg.name)}"
|
||||||
|
title="Package Details">
|
||||||
|
Package details</a>
|
||||||
|
</p>
|
||||||
|
<div class="package subsection">
|
||||||
|
<h3>WMS preview</h3>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
CKAN.MapViewer.setup("${c.url}");
|
CKAN.MapViewer.setup("${c.pkg.url}");
|
||||||
})
|
})
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
<div id="map"></div>
|
<div id="map"></div>
|
||||||
<div id="layers"></div>
|
<div id="layers"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<xi:include href="../../layout.html" />
|
<xi:include href="../../layout.html" />
|
||||||
|
|
Loading…
Reference in New Issue