Commit graph

520 commits

Author SHA1 Message Date
Roman Deev
dae7a003fe Use baselayerchange/overlaylayerchange instead of layeradd/layerremove for speed up Map Data layer render 2025-01-27 15:44:46 +03:00
mmd-osm
87e995bd84 Added error handling for data layer 2025-01-24 23:14:08 +01:00
Anton Khorev
9d7e59784f Install add/remove event listeners directly on note layer 2025-01-15 02:02:47 +03:00
Etilène Jourdier
0f2df0b9ef display an encouragement to contribute after many anonymous notes
create a counter of anonymous notes in a cookie, read by new note controller to display an encouragement to contribute in the already existing anonymous warning if the anonymous visitor has already created at least 10 anonymous notes. Cookie deleted on log-in and sign-up after email validation
2025-01-13 14:36:21 +03:00
Tom Hughes
6e444155d6 Merge remote-tracking branch 'upstream/pull/5471' 2025-01-05 16:23:49 +00:00
Anton Khorev
c887f1d7b2 Use details attribute to render changeset bounding box
Do this instead of using L.OSM.DataLayer. DataLayer makes an extra request just to get the bbox. Also it expects bbox to always exist, which is not true for some changesets.
2025-01-05 18:18:33 +03:00
Anton Khorev
b816f5b27e Remove 'center' argument of addChangeset()
It is always set to true.
2025-01-05 17:28:36 +03:00
Anton Khorev
7a99295884 Remove zoomend listener on history unload 2025-01-05 15:02:25 +03:00
Anton Khorev
27aa2ed591 Move new note marker to click location
If not done, it's possible to lose the marker when starting from low zooms.
2025-01-01 02:34:22 +03:00
Anton Khorev
5603309026 Decrease new note marker opacity when zoomed out 2025-01-01 02:34:22 +03:00
Anton Khorev
feb7af2020 Let page.load proceed when zoomed out, disabling submit
Note that addNoteButton.hasClass("active") check in page.load is useless because page.unload removes this class.
2025-01-01 02:32:06 +03:00
Anton Khorev
17ab002c04 Remove active class from addNoteButton only in page.unload()
Same reasons as in the previous commit.
2025-01-01 02:13:59 +03:00
Anton Khorev
5542858315 Call removeNewNoteMarker() only from page.unload()
It was also called from noteCreated() but that triggered page.unload() via OSM.router.route().
2025-01-01 02:13:59 +03:00
Anton Khorev
6cc31259e4 Add addNewNoteMarker() and removeNewNoteMarker() functions
This ensures that marker is always added/removed together with its halo.
2025-01-01 02:13:59 +03:00
Anton Khorev
4ea6077ddb Convert newHalo() to addHalo() and removeHalo()
newHalo() wasn't always creating new halos. It had an event type argument that was checked against drag event. Depending on this check, newHalo() could remove the halo.
2025-01-01 01:53:55 +03:00
Anton Khorev
f1835c914c Move new note page.pushstate/popstate next to page.load 2024-12-31 23:47:55 +03:00
Anton Khorev
dc59b37fe1 Add new note marker to root map layer instead of noteLayer
We want the new note marker in the same layer with its halo. Also we don't want to put anything in noteLayer because it clears its contents on certain zoom levels.
2024-12-31 23:47:55 +03:00
Anton Khorev
18f3adbf5d Remove unused return value of addCreatedNoteMarker()
This function adds a marker to notes layer. This controller doesn't need to do anything with markers of existing notes.
2024-12-31 23:46:29 +03:00
Anton Khorev
ae5b7812cc Rename updateMarker() to addCreatedNoteMarker()
This function doesn't update any existing marker.
2024-12-31 23:46:29 +03:00
Anton Khorev
9d8ca8be11 Pass location instead of marker to createNote() 2024-12-31 23:42:40 +03:00
Anton Khorev
954eafd424 Move create note callback to button click handler 2024-12-31 23:37:34 +03:00
Anton Khorev
f169299b53 Don't pass url to createNote() 2024-12-31 23:25:11 +03:00
Anton Khorev
63a4f12550 Pass text instead of form to createNote() 2024-12-31 23:22:59 +03:00
Anton Khorev
fa0c12cdcd Disable new note submit button in click handler 2024-12-31 23:02:47 +03:00
Anton Khorev
c4709e2a05 Rename newNote to newNoteMarker 2024-12-31 22:37:41 +03:00
Anton Khorev
25e4a80760 Get note text only from textarea within left sidebar 2024-12-19 05:22:54 +03:00
Tom Hughes
8a020b3ec7 Don't send comment text when reopening a note
Fixes #5359.
2024-11-29 17:41:00 +00:00
Anton Khorev
aca9bd205e Add subscribe/unsubscribe buttons to note pages 2024-11-22 00:55:41 +03:00
Andy Allan
7f611b295f
Merge pull request #5151 from AntonKhorev/no-history-and-export-buttons
Move History and Export buttons to secondary nav
2024-11-13 19:15:59 +00:00
Anton Khorev
f6141277d5 Remove unused timer from new note js controller 2024-11-13 15:54:20 +03:00
Anton Khorev
771b75ed71 Replace query marker fade animation with css 2024-11-08 10:50:47 +03:00
Anton Khorev
34e0620463 Remove callback from initialize() in note js controller 2024-10-25 18:48:36 +03:00
Jakob Miksch
4f79ae4612
Typos in docs 2024-10-20 11:12:49 +02:00
Anton Khorev
7fb432dc32 Close small mode menu on some interactions 2024-09-03 02:59:18 +03:00
Anton Khorev
1e9603c7b1 Remove endpoint/input values on disable 2024-08-21 11:43:26 +03:00
Anton Khorev
a088b136fb Read lat/lon attributes when generating context menu directions urls 2024-08-20 14:55:29 +03:00
Anton Khorev
4f3576e91b Save lat/lon to input data attributes 2024-08-20 14:55:29 +03:00
Anton Khorev
b4925d7b0d Limit coordinate precision in drag listener 2024-08-20 14:55:29 +03:00
Anton Khorev
5a1e3e5c67 Replace geocode request boolean property with request object 2024-08-19 20:30:51 +03:00
Anton Khorev
a8838b3727 Remove endpoint markers in disable method 2024-08-19 20:30:51 +03:00
Anton Khorev
64da05f8ff Install endpoint listeners using enable/disable methods 2024-08-19 20:30:51 +03:00
Anton Khorev
93a9f31bf0 Show/hide "Where is this?" when setting search value from directions 2024-08-19 20:05:48 +03:00
Tom Hughes
41b81bd393 Merge remote-tracking branch 'upstream/pull/5083' 2024-08-18 12:16:22 +01:00
Anton Khorev
80c43f51c2 Copy "From" endpoint value to search input when closing directions 2024-08-16 18:48:05 +03:00
Anton Khorev
89a35fe11f Make getGeocode a private function 2024-08-16 08:57:39 +03:00
Anton Khorev
51cbbe6d5a Move empty value check out of endpoint.getGeocode 2024-08-16 08:54:23 +03:00
Anton Khorev
e624871eb4 Remove endpoint.hasGeocode state and related getRoute code
hasGeocode didn't actually indicated if an endpoint has a value acquired from a geocoder. It was set to true when at least one call to a geocoder finished successfully, including getting an empty result. getRoute doesn't need to know what calls were made, it only needs coordinates. It also doesn't get to decide when to fetch coordinates, this is done in drag/change callbacks.
2024-08-16 08:53:34 +03:00
Anton Khorev
ec6789920c Rename geocodeCallback to changeCallback, call it from latlon setValue
endpoint.setValue always calls changeCallback on its successful completion, with geocoding or without. This allows to decide when to call getRoute entirely from callbacks and event listeners.
2024-08-15 12:00:31 +03:00
Anton Khorev
f1ca64ff84 Make setLatLng a private function 2024-08-14 05:11:56 +03:00
Anton Khorev
f65593651f Don't set input value from endpoint.setLatLng()
This input value computed from coordinates is not always used. endpoint.getGeocode() overwrites it immediately.
2024-08-14 05:11:56 +03:00