Commit graph

1314 commits

Author SHA1 Message Date
Yohan Boniface
eaf6c17db4 Picto field: only add category when at least one picto matches search 2023-11-13 17:11:40 +01:00
Yohan Boniface
2026a2c7e6 picto field: only add close button once 2023-11-13 17:02:35 +01:00
Yohan Boniface
00a13acb83 Add test covering changing picto from the datalayer 2023-11-13 16:58:54 +01:00
Yohan Boniface
d63d81fec3 Refactor icon search 2023-11-09 08:31:24 +01:00
Yohan Boniface
e509687956 Add first test for pictogram selection 2023-11-09 00:02:44 +01:00
Yohan Boniface
1bf1543668 Refactor icon selector: use tabs, make options more explicit 2023-11-08 18:00:12 +01:00
Yohan Boniface
c16a01778b
Merge pull request #1393 from umap-project/fieldset-triangle
Add triangle icon to form fieldset to make toggle clearer
2023-11-07 22:39:00 +01:00
Yohan Boniface
09fda11242 Use smaller triangles for fieldsets 2023-11-07 19:24:05 +01:00
Yohan Boniface
41f5a51069 Change background in pictograms list 2023-11-07 19:09:37 +01:00
Yohan Boniface
3034ebc50b
Merge pull request #1388 from umap-project/pictogram-category
Pictogram category
2023-11-07 18:01:15 +01:00
Yohan Boniface
03b837ade6 Add triangle icon to form fieldset to make toggle clearer 2023-11-07 17:57:10 +01:00
Joachim Schleicher
952385b1cd default fill-opacity for polygons
'null' is not a sensible default
2023-11-01 15:55:06 +01:00
Joachim Schleicher
af969eb5c0 incorporate review feedback for markers
* drop and div marker increased to 36px size
* adjust drop arrow accordingly
* black box-shadow with increased spread
2023-11-01 14:32:09 +01:00
Yohan Boniface
407e2dc46a Fix race condition with cluster layer
This occurs when the cluster layer has a min/maxZoom defined, the
map is loaded inside this zoom range BUT the defaultView=data, and
would immediately change the current zoom to a value outside this range.

In this case, the datalayer is added to the map, then the data is requested,
then the map view is recomputed with the full data bounds.

There may be a better fix on our side, but given there is async in the middle,
it can be time consuming and can add complexity (with more events and listeners)
to properly make it work.
2023-11-01 10:49:31 +01:00
Yohan Boniface
e9deaab2bc i18n 2023-11-01 08:17:56 +01:00
Yohan Boniface
402455c494 Change edit toolbar secondary button style 2023-10-31 17:57:01 +01:00
Yohan Boniface
5d410c94e3 Update save button style 2023-10-31 17:28:42 +01:00
Yohan Boniface
37094ec6df Update white eye closed 2023-10-31 16:32:54 +01:00
Yohan Boniface
f61f1415ce Update pictograms import script to deal with category and SVG 2023-10-30 21:35:22 +01:00
Yohan Boniface
8c774fb7b3 Add Pictogram.category and list pictos grouped by category 2023-10-30 21:07:55 +01:00
Yohan Boniface
b10838c5ba Automagically change svg icon color according to background color 2023-10-30 18:14:41 +01:00
Yohan Boniface
b6aa201397 Use FileField instead of ImageField for pictogram to allow SVG 2023-10-30 12:45:05 +01:00
Yohan Boniface
e5c616b49c Fix tests 2023-10-27 20:51:50 +02:00
Yohan Boniface
c578decdec 1.10.0 2023-10-27 20:09:42 +02:00
Yohan Boniface
40addf2ce4 i18n 2023-10-27 20:06:37 +02:00
David Larlet
539175f89c
Default message when drawing an existing line/shape 2023-10-27 13:49:26 -04:00
David Larlet
4250712741
More consistent color for close button in alert 2023-10-27 13:40:44 -04:00
David Larlet
bfd4b96807
Better responsive alignment of topbar icons and texts 2023-10-27 13:37:17 -04:00
David Larlet
c25de24009
Fix the bottom padding of help button in topbar 2023-10-27 13:24:12 -04:00
David Larlet
0c4495e356
Fix the z-index of the tooltip above sidepanel 2023-10-27 13:19:47 -04:00
David Larlet
a79e165de1
Fix position of pencil for deactivated layers 2023-10-27 13:18:19 -04:00
Yohan Boniface
8773a63e90
Merge pull request #1386 from umap-project/update-eye-icon
Update eye icon
2023-10-27 19:12:33 +02:00
Yohan Boniface
20767f7dc6
Merge pull request #1385 from umap-project/tooltip-mouseout
Cancel tooltip on mouseout
2023-10-27 19:12:03 +02:00
Yohan Boniface
d5ab5ac529 Update eye icon 2023-10-27 19:11:07 +02:00
Yohan Boniface
80a88d2c6f Change save button display 2023-10-27 18:58:41 +02:00
Yohan Boniface
9d9b726af5 Cancel tooltip on mouseout
Prevent a tooltip to be displayed if the user has moved out
the mouse from the anchor.
2023-10-27 18:45:58 +02:00
David Larlet
dde6254d16
Fix: set step any for float input with decimals
Useful for latitudes and longitudes.
2023-10-27 11:56:02 -04:00
David Larlet
67d89874e8
Merge pull request #1290 from umap-project/a11y-from-links-to-buttons
A11Y: switch from links to buttons when pertinent
2023-10-27 11:53:23 -04:00
David Larlet
312ebf5a0d
Remove JS inline style made useless 2023-10-27 11:47:33 -04:00
David Larlet
ff9b462531
All left sidebar icons with white background 2023-10-27 11:40:28 -04:00
David Larlet
860e475219
Center the tooltip (arrow) for bottom position 2023-10-27 11:32:03 -04:00
David Larlet
1d65ce6b49
Better labels and icons for edit/preview modes
Fix #556
2023-10-27 11:31:34 -04:00
David Larlet
2f424b7539
Flat button for icon shapes direct input 2023-10-27 10:35:26 -04:00
Yohan Boniface
60a0f14439
Merge pull request #1382 from umap-project/fix-global-variable
Fix variable declared globally by mistake
2023-10-27 16:12:44 +02:00
Yohan Boniface
41ec18a08d Fix variable declared globally by mistake
This can have an impact in map listing, because dataToload will
be shared.
2023-10-27 16:12:12 +02:00
Yohan Boniface
a0da0b31a7
Merge pull request #1383 from umap-project/default-view-datalayer
Split defaultDatalayer in defaultView/EditDatalayer
2023-10-27 16:03:14 +02:00
Yohan Boniface
f053e06686 Default view datalayer code refacto 2023-10-27 15:59:37 +02:00
Yohan Boniface
b80d88f7b9
Merge pull request #1384 from umap-project/onload-at-import
Fix displayOnLoad not honoured at import
2023-10-27 15:47:35 +02:00
Yohan Boniface
c5a28755a2 Fix JS tests related to a11y a to button change 2023-10-27 12:55:24 +02:00
Yohan Boniface
882cc74bcf Fix displayOnLoad not honoured at import
fix #1043
2023-10-27 12:25:40 +02:00
Yohan Boniface
29ab98ede3 Split defaultDatalayer in defaultView/EditDatalayer
In view mode, we don't want the fallback to create a new datalayer.
2023-10-27 11:54:35 +02:00
Yohan Boniface
85389699fd
Merge pull request #1379 from umap-project/default-props-no-redraw
Keep only non graphic props in default properties, to prevent useless redraw
2023-10-27 09:11:07 +02:00
Yohan Boniface
986e70637a Prevent more useless redraw when editing global settings 2023-10-26 23:07:02 +02:00
Yohan Boniface
9eea9f942d
Merge pull request #1380 from umap-project/range-step-rounding
Round range step to 1 digit
2023-10-26 22:56:47 +02:00
Yohan Boniface
ac56194487
Merge pull request #1381 from umap-project/max-zoom-limit-24
Increase maxZoomLimit to 24
2023-10-26 22:56:22 +02:00
Yohan Boniface
852857412b Increase maxZoomLimit to 24
Even if this limit is not a hard limit, just a warning, we now
have been proven some maps using custom backgrounds use zooms
greater than 20.

Eg. this maps which allows zoom until 23:

https://umap.openstreetmap.fr/fr/map/cimetiere-asnieres-la-giraud_716488
2023-10-26 22:40:54 +02:00
Yohan Boniface
bacf8922c8 Round range step to 1 digit 2023-10-26 22:38:41 +02:00
Yohan Boniface
59e4fb9663
Merge pull request #1376 from umap-project/csv-export
Add minimal CSV export
2023-10-26 19:23:34 +02:00
Yohan Boniface
9d5ff35636 Keep only non graphic props in default properties, to prevent useless redraw 2023-10-26 17:21:45 +02:00
Yohan Boniface
9434744219 Fix filter data crashing when data contains non string values
It may happen when data comes from an import.

fix #1377
2023-10-26 16:54:43 +02:00
Yohan Boniface
78b6025ef1 Add minimal CSV export
cf https://forum.openstreetmap.fr/t/export-csv-depuis-une-umap/18290
cf #123
fix #608
2023-10-26 14:28:18 +02:00
Yohan Boniface
47e5a0676a Fix max not loading when defaultView=latest and datalayer has no data
When the default datalayer has no data, we need a fallback

fix #1374
2023-10-24 15:08:42 +02:00
Joachim Schleicher
9b22cb4ab7 prettier.js
fixup 836c17f
2023-10-22 20:52:35 +02:00
Joachim Schleicher
86b27ceb0f pin marker: fix ball 'square'ish 2023-10-22 19:49:52 +02:00
Joachim Schleicher
b149a69efd add test case for path higlight
therefore setting opacity of the example path to 0.6
2023-10-19 21:31:52 +02:00
Joachim Schleicher
7d6830c7c6 add test case for 88746d5 2023-10-19 21:08:57 +02:00
Joachim Schleicher
88746d593c move higlight() into Marker class
options.icon pointer is invalid after hide() show() cycle.
2023-10-19 20:57:40 +02:00
Yohan Boniface
219b3e17dd Fix picto in add datalayer button 2023-10-18 11:52:07 +02:00
Yohan Boniface
d30f35ad78 1.9.3 2023-10-18 09:13:07 +02:00
Yohan Boniface
412a159cc2
Merge pull request #1370 from umap-project/drag-n-drop
Add experimental drag and drop of file on the map container
2023-10-18 09:12:10 +02:00
Joachim Schleicher
5778c4ff65 add testcase for marker highlight 2023-10-17 21:45:05 +02:00
Yohan Boniface
c50e21e395 Release scroll wheel zoom on drop 2023-10-17 21:15:47 +02:00
Joachim Schleicher
65ba1cd3ee simply call _redraw to reset style
thanks for the review to @yohanboniface
2023-10-17 20:55:37 +02:00
Yohan Boniface
48c86812b6 i18n 2023-10-17 10:35:51 +02:00
David Larlet
1d94ebbaa3
Responsiveness of the header when logged in 2023-10-16 16:28:41 -04:00
David Larlet
85c1af2b50
Use the createLink function when pertinent 2023-10-16 16:19:03 -04:00
David Larlet
8656ca3059
Deal with browsable layers from left sidebar 2023-10-16 15:46:11 -04:00
David Larlet
740ff90262
Keep save button in blue on hover 2023-10-16 15:37:25 -04:00
David Larlet
222af1b528
Header’s styles for logged in user 2023-10-16 15:37:09 -04:00
David Larlet
e87a77cf43
Hide the next icon in buttons’ sprites 2023-10-16 15:18:16 -04:00
David Larlet
9c7269eabc
Better styles for buttons and tooltips 2023-10-16 14:48:20 -04:00
David Larlet
79117f2a66
Better styles for buttons (vs. links) 2023-10-16 10:23:31 -04:00
David Larlet
7695906c38
Better styles for buttons (vs. links) 2023-10-16 10:23:30 -04:00
David Larlet
a28d427ba1
Set a default type="button" for JS buttons
> The `button` [type] has no default behavior, and does nothing when pressed by default. It can have client-side scripts listen to the element's events, which are triggered when the events occur. — https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
2023-10-16 10:22:21 -04:00
David Larlet
688ef19c04
A11Y: switch from links to buttons when pertinent 2023-10-16 10:22:20 -04:00
Yohan Boniface
eda14bd742 Add affordance to drag-n-drop file onto the map 2023-10-13 17:02:08 +02:00
Yohan Boniface
b5bf1396f3 Experimental drag and drop of file on the map container 2023-10-13 12:01:19 +02:00
Yohan Boniface
3c234ead5b Add missing function after cherry-picking 2023-10-13 12:00:59 +02:00
Yohan Boniface
a94cac53ac Move map.importPanel to controls, as other similar functions 2023-10-13 11:58:47 +02:00
Yohan Boniface
d0782b8220 1.9.2 2023-10-12 11:45:41 +02:00
Yohan Boniface
7bdd56ee9e
Merge pull request #1369 from umap-project/heatlayer-map
Add back HeatLayer._map reference check
2023-10-12 11:45:05 +02:00
Yohan Boniface
1e8c51b0e5 Add back HeatLayer._map reference check
In some situation, the property is undefined, given the call is async,
and we can add/remove the layer during the async stack
2023-10-12 11:06:14 +02:00
Yohan Boniface
1f61378aac Fix map reference in DataLayersControl
This would create an error when DataLayersControl is not added to
the map, but the mouseenter/leave event would still be active through
the datalayers list
2023-10-12 10:57:05 +02:00
Yohan Boniface
23404e9870 1.9.1 2023-10-12 10:12:49 +02:00
Yohan Boniface
8fdddddc9e Prevent computing choropleth breaks for each feature when importing
When importing a choropleth layer, the layer does not have a umap_id,
thus "hasDataLoaded" is immediately true, instead of being true when
all the "known" data is imported.

At this point, I can't find a good reason to keep the check on umap_id,
so let's remove and move forward.
2023-10-12 10:07:51 +02:00
Yohan Boniface
7318ebd2f9 choropleth: be more defensive when consuming breaks 2023-10-12 10:06:19 +02:00
Yohan Boniface
e751cd0fc4 1.9.0 2023-10-12 09:21:22 +02:00
Yohan Boniface
3119c75fb2 i18n 2023-10-12 09:19:37 +02:00
Yohan Boniface
6aa6eb4c11
Merge pull request #1136 from umap-project/choropleth
Add experimental choropleth datalayer type
2023-10-12 08:47:30 +02:00
Yohan Boniface
02342c487a Choropleth: allow to control breakpoints manually 2023-10-12 08:39:47 +02:00
Yohan Boniface
dac1f16bc6
Merge pull request #1358 from umap-project/heat-improvements
Heatmap improvements
2023-10-11 22:50:30 +02:00
Yohan Boniface
c2feba1df0
Merge pull request #1349 from umap-project/toggle-attribution
Hide attribution on small screen and add a small ? to display it
2023-10-11 22:49:44 +02:00
Yohan Boniface
739626351c Choropleth: replace chromajs by colorbrewer + simple-statistics
simple-statistics has a few advantages:
- faster
- more accurate kmeans algo
- Jenks-Fisher algo

Also, I suspect will use it again for next step, which is Bubble
mode layer.
2023-10-11 19:36:12 +02:00
Yohan Boniface
e97e566c42 Use non full white as left color for default choropleth color scale 2023-10-10 21:58:38 +02:00
Yohan Boniface
3d2ad3c1c6
Update umap/static/umap/map.css
Co-authored-by: David Larlet <3556+davidbgk@users.noreply.github.com>
2023-10-10 21:40:34 +02:00
Yohan Boniface
bcd9b1ac04 Fix getOption not considering null values 2023-10-10 21:22:19 +02:00
Yohan Boniface
84a5b3c6f5 Fix Choropleth JS tests 2023-10-10 21:22:19 +02:00
Yohan Boniface
7be238a4ab Add minimal Choropleth integration test 2023-10-10 21:22:17 +02:00
Yohan Boniface
3b304e5249 Tests: populate settings from _umap_options when data is passed 2023-10-10 21:19:20 +02:00
Yohan Boniface
35758a1e13 Choropleth: do not add layer before knowing the whole dataset
And only compute limits once.
2023-10-10 21:16:01 +02:00
Yohan Boniface
d9522d9c1f Add default value to choropleth mode MultiChoice 2023-10-10 21:16:01 +02:00
Yohan Boniface
ce39afc64a Allow to override MultiChoice default value 2023-10-10 21:16:01 +02:00
Yohan Boniface
7fd905741a Use MultiChoice input for "choropleth mode" 2023-10-10 21:16:01 +02:00
Yohan Boniface
3334db3fa2 Use Range input for choropleth steps, and limit to 9
This limit comes from ColorBrower sequential color sets, which
we use.
2023-10-10 21:16:01 +02:00
Yohan Boniface
82bb017b23 Basic Choropleth tests 2023-10-10 21:16:01 +02:00
Yohan Boniface
125aa72785 Make choropleth mode work with lines 2023-10-10 21:16:01 +02:00
Yohan Boniface
7b68c52a15 Allow to select choropleth property from a list instead of gessing it 2023-10-10 21:16:01 +02:00
Yohan Boniface
6c502c54b4 Better defaults for choropleth layer 2023-10-10 21:16:01 +02:00
Yohan Boniface
451eb8c0bf Naive Choropleth legend, WIP 2023-10-10 21:16:01 +02:00
Yohan Boniface
7a0dbd014a There is one more limit than the number of steps
Limits are steps boundaries, and first limit is always the lower value,
and latest limit always the bigger.
2023-10-10 21:16:01 +02:00
Yohan Boniface
bf116e8d93 Use brewer palettes for choropleth colors
cf https://gka.github.io/chroma.js/#chroma-brewer
2023-10-10 21:16:01 +02:00
Yohan Boniface
5d350a7cc9 Control property used in choropleth 2023-10-10 21:16:01 +02:00
Yohan Boniface
8e12e6cf24 POC of a choropleth layer 2023-10-10 21:16:01 +02:00
Yohan Boniface
31ea8d1a83
Merge pull request #1362 from umap-project/hide-datalayer-in-caption
Allow to hide a datalayer from the caption list
2023-10-10 21:06:09 +02:00
Joachim Schleicher
9ef09512db highlight: increase fillOpacity for polygons
sqrt gives larger increase for low opacities like 0.2
while preserving some (tiny) shine-through for large values like 0.8
and is limited to the desired range of (0,1]
2023-10-10 10:47:36 +02:00
Joachim Schleicher
836c17f2e8 fire events from Popup Panel
to also highlight path and markers when using the side panel.
Therefore we duplicate the event code from the base class.
2023-10-10 10:29:20 +02:00
Joachim Schleicher
3594bc2605 highlight markers
add .umap-icon-active class for currently selected marker icon.
CSS styles override the marker styles to display
* in the foreground
* with full opacity
* with larger sizes where possible (ball and circle)
2023-10-10 10:29:20 +02:00
Yohan Boniface
da01977414 Fix permissions tests 2023-10-09 18:30:44 +02:00
Yohan Boniface
547485e50f Allow to hide a datalayer from the caption list 2023-10-06 22:26:31 +02:00
Yohan Boniface
de6c9f3b84 Make sure we don't use DataLayer.settings by reference 2023-10-06 22:25:56 +02:00
Joachim Schleicher
7696203159 highlight selected path
when opening a popup increase opacity and weight.
In maps with multiple lines one can see much easier, where the line
starts and ends.
2023-10-05 21:18:05 +02:00
Yohan Boniface
5bfa2fce38 Patch HeatLayer for better rendering
Patch comes from https://github.com/Leaflet/Leaflet.heat/pull/78

We'll remove it when this PR get merged and released.
2023-10-05 18:15:59 +02:00
Yohan Boniface
ca7257658c Make that Range inherit from FloatInput
Otherwise we store a string
2023-10-05 18:15:21 +02:00
Yohan Boniface
3e54310c8d Add Range input for heatmap radius 2023-10-05 17:36:07 +02:00
Yohan Boniface
a5c7214533 Add back helpText on Range input 2023-10-05 17:32:27 +02:00
Yohan Boniface
20cdc837af Use toFixed instead of toPrecision in Range input
toPrecision returns an exponential notation for example for:
 const x = 100
 x.toPrecision(2)
2023-10-05 15:14:28 +02:00
Yohan Boniface
34122b1549
Remove unused CSS class .third
Co-authored-by: Joachim Schleicher <joachimsl@gmx.de>
2023-10-04 09:36:55 +02:00
Joachim Schleicher
79a1ea232a switch to grid layout for multiple choice buttons
to allow multi-line texts in translations
2023-10-04 09:19:09 +02:00
Yohan Boniface
495dd6444f Finally add Map.create_at field
This field should have been added at the beginning, but this is
like planting trees, isn't it ?
2023-09-27 11:01:50 +02:00
Yohan Boniface
ff27cdd04a Hide attribution on small screen and add a small ? to display it
fix #844
2023-09-27 10:30:57 +02:00
Yohan Boniface
f73308e99d 1.8.2 2023-09-27 07:21:06 +02:00
Yohan Boniface
677fd3d982
Merge pull request #1336 from umap-project/shared-edit-url
Redirect to canonical when URL contains the ?edit parameter
2023-09-27 07:17:29 +02:00
Yohan Boniface
013d2fd5ee Always remove ?edit from URL, so users do not share it by mistake 2023-09-27 07:13:30 +02:00
Yohan Boniface
50591e1ac5 i18n 2023-09-27 06:48:00 +02:00
Joachim Schleicher
ccda9aca3f Fix #1308
The star indicating a dirty map uses more than 5px (depending on font-size).
So the additional star switched from showing the map name to
ellipses-overflow in px-implementation.
1ch is the with of the digit '0'.
2023-09-26 20:57:58 +02:00
Yohan Boniface
cae52c905a
Merge pull request #1346 from umap-project/short-url-none
Make sure SHORT_SITE_URL is defined to expose Map.short_url
2023-09-26 15:52:51 +02:00
David Larlet
af3518ad08
Apply Black to settings files 2023-09-26 09:40:41 -04:00
Yohan Boniface
44910f5410 Do no try to fit data bounds if bounds are not valid
This may happen if:
- the map as some layers containing data, but set as not browsable
- any other layer is empty
2023-09-26 10:49:01 +02:00
Yohan Boniface
c1698545bd Make sure SHORT_SITE_URL is defined to expose Map.short_url 2023-09-26 10:34:50 +02:00
Yohan Boniface
649f21a0d5
Merge pull request #1339 from umap-project/browse-in-bbox
Allow to restrict data browser items to current map view
2023-09-26 08:16:22 +02:00