You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the 2.x branch.
Discussion
----------
[Map] Add Marker Icon customization capability
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Issues | Fix#2109 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
A nicely asked feature, adding Marker icon customization, it can be an UX Icon, an URL, or a SVG content:
```php
// It can be a UX Icon (requires `symfony/ux-icons` package)...
$icon = Icon::ux('fa:map-marker')->width(24)->height(24);
// ... or an URL pointing to an image
$icon = Icon::url('https://example.com/marker.png')->width(24)->height(24);
// ... or a plain SVG string
$icon = Icon::svg('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24">...</svg>');
$map->addMarker(new Marker(
// ...
icon: $icon
));
```
## Rendering

Commits
-------
c4f9828 [Map] Rework UxIconRenderer injection
9976692 [Map] Rework SvgIcon and factory method name, UX Icon to get generated HTML, and icons rendering
311689c [Map] Refactor and simplify the way to create a custom Icon
73151f6 [Map] Define IconTypes and IconType in TypeScript
dd20dbe feat: custom icon on markers
0 commit comments