Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manage worldmap client using client hooksets standard approach. Refs #…
…4019 (#4023) * Manage worldmap client using client hooksets standard approach. Ref #4019 * Forgot to add these files in previous commit * we use geoext client by default
- Loading branch information
Showing
19 changed files
with
353 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% load static from staticfiles %} | ||
<script src="{% static "worldmap_client/script/ux.js" %}?v={{ VERSION }}"></script> | ||
<script src="{% static "worldmap_client/script/GeoNode.js" %}?v={{ VERSION }}"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% load static from staticfiles %} | ||
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/ext/resources/css/ext-all.css" %}?v={{ VERSION }}" /> | ||
<script type="text/javascript" src="{% static "worldmap_client/externals/ext/adapter/ext/ext-base.js" %}?v={{ VERSION }}"></script> | ||
<script type="text/javascript" src="{% static "worldmap_client/externals/ext/ext-all.js" %}?v={{ VERSION }}"></script> | ||
|
||
<script type="text/javascript"> | ||
Ext.Ajax.defaultHeaders = { 'X-CSRFToken': '{{ csrf_token|escapejs }}' }; | ||
Ext.BLANK_IMAGE_URL = "{% static "worldmap_client/externals/ext/resources/images/default/s.gif" %}"; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{% load api_basemaps_tags %} | ||
{% load i18n %} | ||
{% load static from staticfiles %} | ||
|
||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/theme/site.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/ext/resources/css/ext-all.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/openlayers/theme/default/style.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/geoext/resources/css/geoext-all.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/gxp/theme/all.css" %}?v={{ VERSION }}"> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/ext/resources/css/xtheme-white.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/theme/app/geoexplorer_white.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/theme/ux/colorpicker/color-picker.ux.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/theme/theme/ux/spinner/Spinner.css" %}?v={{ VERSION }}" /> | ||
|
||
<script src="{% static "worldmap_client/script/OpenLayers.js" %}?v={{ VERSION }}" type="text/javascript"></script> | ||
<script src="{% static "worldmap_client/script/GeoExt.js" %}?v={{ VERSION }}" type="text/javascript"></script> | ||
<script src="{% static "worldmap_client/script/gxp.js" %}?v={{ VERSION }}" type="text/javascript"></script> | ||
<script src="{% static "worldmap_client/script/GeoExplorer.js" %}?v={{ VERSION }}" type="text/javascript"></script> | ||
|
||
<script src="https://maps.googleapis.com/maps/api/js?key={% google_api_key %}" type="text/javascript"></script> | ||
|
||
<script type="text/javascript" src="/static/geonode/js/utils/thumbnail.js"></script> | ||
<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script> | ||
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{% load api_basemaps_tags %} | ||
{% load i18n %} | ||
{% load static from staticfiles %} | ||
|
||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/theme/site.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/ext/resources/css/ext-all.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/openlayers/theme/default/style.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/geoext/resources/css/geoext-all.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/gxp/theme/all.css" %}?v={{ VERSION }}"> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/externals/ext/resources/css/xtheme-white.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/theme/app/geoexplorer_white.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/theme/ux/colorpicker/color-picker.ux.css" %}?v={{ VERSION }}" /> | ||
<link rel="stylesheet" type="text/css" href="{% static "worldmap_client/theme/theme/ux/spinner/Spinner.css" %}?v={{ VERSION }}" /> | ||
|
||
<script src="http://localhost:9090/script/OpenLayers.js" type="text/javascript"></script> | ||
<script src="http://localhost:9090/script/GeoExt.js" type="text/javascript"></script> | ||
<script src="http://localhost:9090/script/gxp.js" type="text/javascript"></script> | ||
<script src="http://localhost:9090/script/GeoExplorer.js" type="text/javascript"></script> | ||
|
||
<script src="https://maps.googleapis.com/maps/api/js?key={% google_api_key %}" type="text/javascript"></script> | ||
|
||
<script type="text/javascript" src="/static/geonode/js/utils/thumbnail.js"></script> | ||
<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script> | ||
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script> |
61 changes: 61 additions & 0 deletions
61
geonode/client/templates/worldmap/layers/layer_worldmap_map.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{% include "worldmap/ext_header.html" %} | ||
{% include "worldmap/app_header.html" %} | ||
{% include "worldmap/geo_header.html" %} | ||
|
||
{% load i18n %} | ||
{% load static from staticfiles %} | ||
|
||
<script type="text/javascript"> | ||
{% autoescape off %} | ||
|
||
var styleEditor, modified = false; | ||
Ext.onReady(function() { | ||
var config = { | ||
tools: [{ | ||
ptype: "gxp_wmsgetfeatureinfo", | ||
format: "grid", | ||
actionTarget: "main.tbar", | ||
outputConfig: {width: 400, height: 200, panIn: false} | ||
}], | ||
proxy: "/proxy/?url=", | ||
siteUrl: "{{ SITE_URL }}", | ||
localGeoServerBaseUrl: "{{GEOSERVER_BASE_URL}}", | ||
rest: "/maps/", | ||
portalConfig: { | ||
renderTo: "preview_map", | ||
height: 350 | ||
}, | ||
createTools: function() { | ||
return [new Ext.Button({ | ||
tooltip: GeoExplorer.prototype.backgroundContainerText, | ||
iconCls: 'icon-layer-switcher', | ||
menu: new gxp.menu.LayerMenu({ | ||
layers: this.mapPanel.layers | ||
}) | ||
})] | ||
}, | ||
listeners: { | ||
"ready": function() { | ||
var map = app.mapPanel.map; | ||
layerExtent = map.layers.slice(-1)[0].maxExtent; | ||
if (layerExtent.left <= map.maxExtent.left || layerExtent.right >= map.maxExtent.right || layerExtent.top >= map.maxExtent.top || layerExtent.bottom <= map.maxExtent.bottom) | ||
{map.zoomTo(1)} | ||
else | ||
{map.zoomToExtent(layerExtent)}; | ||
}, | ||
"beforeunload": function() { | ||
if (modified) { | ||
styleEditor.show(); | ||
return false; | ||
} | ||
} | ||
} | ||
}; | ||
|
||
config = Ext.apply(config, {{ viewer|safe }}); | ||
app = new GeoExplorer.Viewer(config); | ||
|
||
}); | ||
|
||
{% endautoescape %} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{% include "worldmap/ext_header.html" %} | ||
{% include "worldmap/app_header.html" %} | ||
{% include "worldmap/geo_header.html" %} | ||
{% load static from staticfiles %} | ||
<script type="text/javascript" src="{% static "geonode/js/extjs/GeoNode-mixin.js" %}"></script> | ||
<script type="text/javascript" src="{% static "geonode/js/extjs/Geonode-CatalogueApiSearch.js" %}"></script> | ||
<script type="text/javascript" src="{% static "geonode/js/extjs/GeoNode-GeoExplorer.js" %}"></script> | ||
<script type="text/javascript" src="{% static "geonode/js/utils/thumbnail.js" %}"></script> | ||
<script type="text/javascript"> | ||
var app; | ||
Ext.onReady(function() { | ||
{% autoescape off %} | ||
GeoExt.Lang.set("{{ LANGUAGE_CODE }}"); | ||
var config = Ext.apply({ | ||
tools: [{ | ||
ptype: "gxp_wmsgetfeatureinfo", | ||
format: "grid", | ||
actionTarget: "main.tbar", | ||
outputConfig: {width: 400, height: 200, panIn: false} | ||
}], | ||
useToolbar: true, | ||
{% if PROXY_URL %} | ||
proxy: '{{ PROXY_URL }}', | ||
{% endif %} | ||
{% if MAPFISH_PRINT_ENABLED %} | ||
printService: "{{GEOSERVER_BASE_URL}}pdf/", | ||
{% else %} | ||
printService: "", | ||
{% endif %} | ||
rest: "/maps/", | ||
// tell the map viewer where and how to be rendered | ||
portalConfig: { | ||
height: 600, | ||
renderTo: "the_map" | ||
} | ||
}, {{ config }}); | ||
app = new GeoExplorer.Viewer(config); | ||
{% endautoescape %} | ||
}); | ||
</script> |
Oops, something went wrong.