Skip to content

Commit 876e06d

Browse files
committed
Merge branch 'develop' of hub.georepublic.net:gtt/redmine_gtt
2 parents 34d5775 + eadb95c commit 876e06d

File tree

7 files changed

+49311
-47624
lines changed

7 files changed

+49311
-47624
lines changed

app/overrides/issues.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
Deface::Override.new(
22
:virtual_path => "issues/index",
33
:name => "deface_view_issues_index_map",
4-
:insert_after => "erb[loud]:contains('render_query_totals')",
4+
:original => 'b807967c7184cb012c4bd5ccce90893349bc66e3',
5+
:insert_after => "h2",
56
:partial => "issues/index/map"
67
)
78

89
Deface::Override.new(
910
:virtual_path => "issues/index",
1011
:name => "deface_view_issues_index_format_geojson",
12+
:original => '2b4102bf118f0a9866cf50477dce9cc7a78da6d5',
1113
:insert_after => "erb[loud]:contains('PDF')",
1214
:partial => "issues/index/geojson"
1315
)
1416

15-
1617
Deface::Override.new(
1718
:virtual_path => "issues/show",
1819
:name => "deface_view_issues_show_map",
20+
:original => 'f8b29d3fa9c4998090a16b8392242cafbc8cbbcf',
1921
:insert_before => "div.attributes",
2022
:partial => "issues/show/map"
2123
)
2224

2325
Deface::Override.new(
2426
:virtual_path => "issues/show",
2527
:name => "deface_view_issues_show_format_geojson",
28+
:original => '1419e0dcba37f62ff95372d41d9b73845889d826',
2629
:insert_after => "erb[loud]:contains('PDF')",
2730
:partial => "issues/show/geojson"
2831
)

assets/javascripts/app.map.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ App.map = (function ($, publ) {
144144
this.setGeolocation();
145145
this.setGeocoding();
146146
this.zoomToExtent();
147+
this.parseHistory();
147148

148149
// Control button
149150
var maximizeCtrl = new ol.control.Button({
@@ -300,10 +301,36 @@ App.map = (function ($, publ) {
300301
}
301302
};
302303

304+
/**
305+
* Parse page for WKT strings in history
306+
*/
307+
publ.parseHistory = function () {
308+
$('div#history ul.details i').each( function (idx,item) {
309+
var regex = new RegExp(/\w+\s(\((-?\d+.\d+\s?-?\d+.\d+,?)+\))+/g);
310+
var match = $(item).text().match(regex);
311+
if (match !== null) {
312+
var feature = new ol.format.WKT().readFeature(
313+
match[0], {
314+
dataProjection: 'EPSG:4326',
315+
featureProjection: 'EPSG:3857'
316+
}
317+
);
318+
var wkt = new ol.format.WKT().writeFeature(
319+
feature, {
320+
dataProjection: 'EPSG:4326',
321+
featureProjection: 'EPSG:3857',
322+
decimals: 6
323+
}
324+
);
325+
$(item).html('<a href="#" onclick="event.preventDefault();" class="wkt">' + wkt + '</a>');
326+
}
327+
});
328+
};
329+
303330
/**
304331
* Add Geolocation functionality
305332
*/
306-
publ.setGeolocation = function (){
333+
publ.setGeolocation = function () {
307334

308335
geolocation = new ol.Geolocation({
309336
tracking: false,

0 commit comments

Comments
 (0)