+
-
- <% if current_user %>
- <% latest_locations = current_user.recent_locations %>
- <% if latest_locations.count > 0 %>
-
Your recently used locations:
-
- <% latest_locations.each_with_index do |location, index| %>
-
-
- <% if location.place %>
- <%= location.place %>
- <% end %>
- <%= location.lat %>
- <%= location.lon %>
-
-
- <% end %>
+
+
+
+
+
+
+
World
+
Building
- <% end %>
- <% end %>
-
-
-
By dragging the map
-
-
-
Scale
-
-
-
-
- Or by co-ordinates
-
-
+
+
@@ -79,13 +109,14 @@
var options = {
InterfaceOptions: {
latId: 'lat',
- lngId: 'lng'
+ lngId: 'lng',
+ placenameDisplayOnError: ''
},
location: {
- lat: 23 ,
+ lat: 23,
lon: 77
}
- } ;
+ };
var blurredLocation;
@@ -120,13 +151,38 @@
let zoom = blurredLocation.map.getZoom();
$('#ex1').slider('setValue', zoom);
})
+
+ $('#coord_button').click((event) => {
+ event.preventDefault();
+ $('#coord_input').toggle();
+ });
+ $("#coord_input").hide();
+
+ $('#recent_locations').change((event) => {
+ let location = JSON.parse($('#recent_locations').val());
+ blurredLocation.map.setView([location.lat, location.lon], blurredLocation.getZoomFromCoordinates(location.lat, location.lon));
+ });
+
+ var initialPlacename = '';
+ $('#placenameDisplay').on('focusin', function() {
+ initialPlacename = $('#placenameDisplay').val();
+ });
+ $('#placenameDisplay').on('focusout', function() {
+ if($('#placenameDisplay').val() === '') {
+ $('#placenameDisplay').attr('data-preventOverwrite', 'false');
+ } else if ($('#placenameDisplay').val() !== initialPlacename) {
+ $('#placenameDisplay').attr('data-preventOverwrite', 'true');
+ }
+ });
})();
-
+
function saveLocation() {
var tags = 'lat:' + blurredLocation.getLat() + ',lon:' + blurredLocation.getLon() + ',zoom:' + blurredLocation.getZoom();
if (blurredLocation.isBlurred()) tags = tags + ',' + 'location:blurred'
- if ($('#placenameDisplay').val() != 'Location unavailable') tags = tags + ',' + 'place:' + parameterize($('#placenameDisplay').val());
+ if ($('#placenameDisplay').val() !== ('Location unavailable' || '')) {
+ tags = tags + ',' + 'place:' + parameterize($('#placenameDisplay').val());
+ }
<% if params[:url] %>
addTag(tags, '<%= params[:url] %>');
<% else %>
@@ -141,13 +197,3 @@
}
-
-
diff --git a/app/views/locations/_modal.html.erb b/app/views/locations/_modal.html.erb
index 3830ee8ed4..103ed41c17 100644
--- a/app/views/locations/_modal.html.erb
+++ b/app/views/locations/_modal.html.erb
@@ -5,15 +5,9 @@
Enter a location
-
- <%= render partial: 'locations/form' %>
-
-
+
+ <%= render partial: 'locations/form' %>
+
diff --git a/yarn.lock b/yarn.lock
index cf3efad1e1..b1c081b44b 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3,16 +3,16 @@
"@babel/code-frame@^7.0.0":
- version "7.5.5"
- resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d"
- integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e"
+ integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==
dependencies:
- "@babel/highlight" "^7.0.0"
+ "@babel/highlight" "^7.8.3"
-"@babel/highlight@^7.0.0":
- version "7.5.0"
- resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540"
- integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==
+"@babel/highlight@^7.8.3":
+ version "7.8.3"
+ resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797"
+ integrity sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==
dependencies:
chalk "^2.0.0"
esutils "^2.0.2"
@@ -352,9 +352,9 @@ aws-sign@~0.3.0:
integrity sha1-PYHKabR0seFlGHKLUcJP8Lvtxuk=
aws4@^1.8.0:
- version "1.9.0"
- resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.0.tgz#24390e6ad61386b0a747265754d2a17219de862c"
- integrity sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==
+ version "1.9.1"
+ resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e"
+ integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==
backbone@~1.3.3:
version "1.3.3"
@@ -1207,9 +1207,9 @@ cssstyle@^2.0.0:
cssom "~0.3.6"
csv-parse@^4.6.5:
- version "4.8.3"
- resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-4.8.3.tgz#9f9b66c3e7e30409dba3d08ecd89eaa04b320659"
- integrity sha512-0GPxubzYzSn08lhNTWDCkcDKn8krmw0WuscqB2RrW6sugGGskbwaaEz7PCFFwbQ0phNGTTieiyfzzu3S/jZZ7Q==
+ version "4.8.5"
+ resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-4.8.5.tgz#32e92a0e0acedab141bd5c5a3ad6fc3316f2c72d"
+ integrity sha512-rpsLmlLWJZifmLzZEVGbZ9phWnJyi+cCbCGYr4vX2NaHFtgbmQPFk+WmMkmMkQXgsIUn6CgnK9cTuUAfFjoXbA==
ctype@0.5.3:
version "0.5.3"
@@ -1520,9 +1520,9 @@ entities@~1.1.1:
integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
es-abstract@^1.17.0-next.1:
- version "1.17.0"
- resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.0.tgz#f42a517d0036a5591dbb2c463591dc8bb50309b1"
- integrity sha512-yYkE07YF+6SIBmg1MsJ9dlub5L48Ek7X0qz+c/CPCHS9EBXfESorzng4cJQjJW5/pB6vDF41u7F8vUhLVDqIug==
+ version "1.17.2"
+ resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.2.tgz#965b10af56597b631da15872c17a405e86c1fd46"
+ integrity sha512-YoKuru3Lyoy7yVTBSH2j7UxTqe/je3dWAruC0sHvZX1GNd5zX8SSLvQqEgO9b3Ex8IW+goFI9arEEsFIbulhOw==
dependencies:
es-to-primitive "^1.2.1"
function-bind "^1.1.1"
@@ -2464,9 +2464,9 @@ gpu-mock.js@^1.1.1:
integrity sha512-BmoRk9nbMaxkrwzTJp4M0iuwIbzNEXt6tlBZ5+ZYzaGH9VWu5Nhn1Q1CBusCam3d8u3FfVEFf3Ueo8DocUCbUw==
gpu.js@^2.0.0-rc.12:
- version "2.4.8"
- resolved "https://registry.yarnpkg.com/gpu.js/-/gpu.js-2.4.8.tgz#59e980edfdb622b8e5f85ace012214b7d0525911"
- integrity sha512-V4CAZIR+kV6enLVPGoeZdb4lK4FGGuolDDYNBMAlNzrfDN7OJjl2V9we6bKDTKhV/gwsYmivs0x22qo/Q0zHzA==
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/gpu.js/-/gpu.js-2.5.0.tgz#313998145feb8b3535c435bbbc58d3f770b7c21e"
+ integrity sha512-suq+6lqxfpQqc16VdhN5Ve8hYL9lwGRmDRY/ov4b2JUCESW7q320VO+qcadhVM/V9TDiLZVwbI9+3T5bdUUiXg==
dependencies:
acorn "^7.1.0"
gl "^4.4.0"
@@ -2629,9 +2629,9 @@ gtoken@^2.3.2:
pify "^4.0.0"
handlebars@^4.0.1:
- version "4.6.0"
- resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.6.0.tgz#33af6c3eda930d7a924f5d8f1c6d8edc3180512e"
- integrity sha512-i1ZUP7Qp2JdkMaFon2a+b0m5geE8Z4ZTLaGkgrObkEd+OkUKyRbRWw4KxuFCoHfdETSY1yf9/574eVoNSiK7pw==
+ version "4.7.2"
+ resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.2.tgz#01127b3840156a0927058779482031afe0e730d7"
+ integrity sha512-4PwqDL2laXtTWZghzzCtunQUTLbo31pcCJrd/B/9JP8XbhVzpS5ZXuKqlOzsd1rtcaLo4KqAn8nl8mkknS4MHw==
dependencies:
neo-async "^2.6.0"
optimist "^0.6.1"
@@ -3523,8 +3523,8 @@ leaflet-blurred-location@^1.5.1, leaflet-blurred-location@^1.6.0:
leaflet "^1.3.3"
"leaflet-blurred-location@git://github.com/publiclab/leaflet-blurred-location#main":
- version "1.5.1"
- resolved "git://github.com/publiclab/leaflet-blurred-location#550b8ac78144b32e0e01a0dba242a09009f155c8"
+ version "1.6.0"
+ resolved "git://github.com/publiclab/leaflet-blurred-location#ef66dcb768094680e92d4f972b68f18cd4db6ccc"
dependencies:
haversine-distance "^1.1.4"
jquery "^3.2.1"
@@ -5847,9 +5847,9 @@ uc.micro@~0.1.0:
integrity sha1-7aESHR/blhVO1v3oJHu724MzCMo=
uglify-js@^3.1.4:
- version "3.7.4"
- resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.7.4.tgz#e6d83a1aa32ff448bd1679359ab13d8db0fe0743"
- integrity sha512-tinYWE8X1QfCHxS1lBS8yiDekyhSXOO6R66yNOCdUJeojxxw+PX2BHAz/BWyW7PQ7pkiWVxJfIEbiDxyLWvUGg==
+ version "3.7.5"
+ resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.7.5.tgz#278c7c24927ac5a32d3336fc68fd4ae1177a486a"
+ integrity sha512-GFZ3EXRptKGvb/C1Sq6nO1iI7AGcjyqmIyOw0DrD0675e+NNbGO72xmMM2iEBdFbxaTLo70NbjM/Wy54uZIlsg==
dependencies:
commander "~2.20.3"
source-map "~0.6.1"