diff options
author | lxf <sng@luxagraf.net> | 2021-11-06 09:42:47 -0400 |
---|---|---|
committer | lxf <sng@luxagraf.net> | 2021-11-06 09:42:47 -0400 |
commit | d9f51299809bfb6b3ac589b7c42016d0ef240299 (patch) | |
tree | aa5f945e82fdbf1b66aca82fe5122f6ff5a12eb9 /templates/gis/admin | |
parent | dde9914dbbc6cda18ba59024065727c8dc6bcdf4 (diff) |
moved templates to top level directory
Diffstat (limited to 'templates/gis/admin')
-rw-r--r-- | templates/gis/admin/google.html | 5 | ||||
-rw-r--r-- | templates/gis/admin/google.js | 2 | ||||
-rw-r--r-- | templates/gis/admin/openlayers.html | 68 | ||||
-rw-r--r-- | templates/gis/admin/osm.html | 2 | ||||
-rw-r--r-- | templates/gis/admin/osm_extra.js | 4 |
5 files changed, 81 insertions, 0 deletions
diff --git a/templates/gis/admin/google.html b/templates/gis/admin/google.html new file mode 100644 index 0000000..460d28d --- /dev/null +++ b/templates/gis/admin/google.html @@ -0,0 +1,5 @@ +{% extends "gis/admin/openlayers.html" %}
+{% block extrastyle %}{{ block.super }}
+<style type="text/css">v\:* {behavior:url(#default#VML);}</style>
+{% endblock %}
+{% block openlayers %}{% include "gis/admin/google.js" %}{% endblock %}
\ No newline at end of file diff --git a/templates/gis/admin/google.js b/templates/gis/admin/google.js new file mode 100644 index 0000000..3ecb766 --- /dev/null +++ b/templates/gis/admin/google.js @@ -0,0 +1,2 @@ +{% extends "gis/admin/openlayers.js" %}
+{% block base_layer %}new OpenLayers.Layer.Google("Google Base Layer", {'type': G_NORMAL_MAP, 'sphericalMercator' : true});{% endblock %}
diff --git a/templates/gis/admin/openlayers.html b/templates/gis/admin/openlayers.html new file mode 100644 index 0000000..f4efdcc --- /dev/null +++ b/templates/gis/admin/openlayers.html @@ -0,0 +1,68 @@ +{% block extrastyle %} +<script> +function geoFindMe() { + var output = document.getElementById("out"); + + if (!navigator.geolocation){ + output.innerHTML = "<p>Geolocation is not supported by your browser</p>"; + return; + } + + function success(position) { + var lat = position.coords.latitude; + var lon = position.coords.longitude; + var proj = new OpenLayers.Projection("EPSG:4326"); + var point = new OpenLayers.LonLat(lon, lat); + var wkt = point.transform(proj, geodjango_point.map.getProjectionObject()); + var wkttemp = "SRID=3857;POINT(" + wkt.lon + " "+ wkt.lat + ")"; + geodjango_point.map.setCenter(wkt); + var admin_geom = geodjango_point.read_wkt(wkttemp); + geodjango_point.layers.vector.addFeatures([admin_geom]); + }; + + function error() { + output.innerHTML = "Unable to retrieve your location"; + }; + + + navigator.geolocation.getCurrentPosition(success, error); +} +</script> +{% load static %} +<style type="text/css"> + #{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; } + #{{ id }}_map .aligned label { float:inherit; } + #{{ id }}_admin_map { position: relative; vertical-align: top; float: {{ LANGUAGE_BIDI|yesno:"right,left" }}; } + {% if not display_wkt %}#{{ id }} { display: none; }{% endif %} + .olControlEditingToolbar .olControlModifyFeatureItemActive { + background-image: url("{% static "admin/img/gis/move_vertex_on.png" %}"); + background-repeat: no-repeat; + } + .olControlEditingToolbar .olControlModifyFeatureItemInactive { + background-image: url("{% static "admin/img/gis/move_vertex_off.png" %}"); + background-repeat: no-repeat; + } +</style> +<!--[if IE]> +<style type="text/css"> + /* This fixes the mouse offset issues in IE. */ + #{{ id }}_admin_map { position: static; vertical-align: top; } + /* `font-size: 0` fixes the 1px border between tiles, but borks LayerSwitcher. + Thus, this is disabled until a better fix is found. + #{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; font-size: 0; } */ +</style> +<![endif]--> +{% endblock %} +<span id="{{ id }}_admin_map"> +<script type="text/javascript"> +//<![CDATA[ +{% block openlayers %}{% include "gis/admin/openlayers.js" %}{% endblock %} +//]]> +</script> +<div id="{{ id }}_map"{% if LANGUAGE_BIDI %} dir="ltr"{% endif %}></div> +<div id="out"></div> +<a href="javascript:{{ module }}.clearFeatures()">Delete all Features</a> +{% if display_wkt %}<p> WKT debugging window:</p>{% endif %} +<textarea id="{{ id }}" class="vWKTField required" cols="150" rows="10" name="{{ name }}">{{ wkt }}</textarea> +<script type="text/javascript">{% block init_function %}{{ module }}.init();{% endblock %}</script> +</span> diff --git a/templates/gis/admin/osm.html b/templates/gis/admin/osm.html new file mode 100644 index 0000000..e27526a --- /dev/null +++ b/templates/gis/admin/osm.html @@ -0,0 +1,2 @@ +{% extends "gis/admin/openlayers.html" %} +{% block openlayers %}{% include "gis/admin/osm_extra.js" %}{% endblock %} diff --git a/templates/gis/admin/osm_extra.js b/templates/gis/admin/osm_extra.js new file mode 100644 index 0000000..478f78c --- /dev/null +++ b/templates/gis/admin/osm_extra.js @@ -0,0 +1,4 @@ +{% extends "gis/admin/openlayers.js" %} +{% block base_layer %} +new OpenLayers.Layer.XYZ( "ESRI", "https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${z}/${y}/${x}", {sphericalMercator: true} ); +{% endblock %} |