Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markers not displayed when (Vaadin) Spring Security is used #485

Closed
4 tasks done
McPringle opened this issue Jan 1, 2025 · 1 comment
Closed
4 tasks done

Markers not displayed when (Vaadin) Spring Security is used #485

McPringle opened this issue Jan 1, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@McPringle
Copy link

Checklist

  • I am able to reproduce the bug with the latest version
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.

Affected version

4.4.0

Steps to reproduce the bug

  1. add vaadin-maps-leaflet-flow to a project
  2. add a map showing a marker
  3. add spring-boot-starter-security
  4. configure HTTP authorization

Expected behavior

The map is displayed, the marker is visible

Actual behavior

The map is displayed, the marker is not visible

Additional information

It turns out the marker is not displayed because a request to the marker will be redirected to the login page. The marker URL is a file in the root directory of the Vaadin application:

http://localhost:8080/marker-icon.png

That looks like a bug. A component should never add files directly to the root directory. It's better to use the sub-directory /icons or /images which usually has a "permit all" to the contents (including subdirectories). So using e.g. /icons/leaflet/marker-icon.png should fix the permission problem with Vaadin / Spring Security.

@McPringle McPringle added the bug Something isn't working label Jan 1, 2025
@AB-xdev AB-xdev self-assigned this Jan 13, 2025
@AB-xdev
Copy link
Member

AB-xdev commented Jan 13, 2025

Thank you for the issue.

However this is working as intended as Leaflet's default marker icon points there:

If you want to use a different URL/icon you can either supply a custom LIcon to your markers or follow the Leaflet docs on how to overwrite the default.

I will add a short section to the Readme that explains the static resources.

The overall situation is also only problematic when one uses a view that has no authentication but the rest of the app has.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants