This guide will cover the basic basics for customising aspects of the Maps UI.
...
Info |
---|
This guide is written with the expectation the reader has a basic knowledge of CSS or JSON |
Note |
---|
Maps Stylesheet uses a mix of CSS and JSON, the line /** LINE REQUIRED - CSS BELOW **/ is required, any JSON must be written above this line and any CSS below. |
...
Expand |
---|
|
Custom Marker iconsIn this example, you’ll be shown how to modify the Maps Stylesheet to achieve customised marker icon. The full CSS can be found at the bottom of this section if you would rather copy and paste this full customisation.  Default markers |  Custom markers |
Firstly, we will modify the .marker .pin element, this is controlling the drop shape of the marker.  Code Block |
---|
| .marker .pin {
border-radius: 50% 50% 50% 50%; /* sets border to complete circle */
} |
Next, we will need to adjust the position of the marker, as we no longer have the point, we’ll move the marker down slightly, this will need to be adjusted for both the current day view as well as future if being used. Code Block |
---|
| .today .marker { /* markers displayed on current day view */
margin-left: -13px !important; /* adjusts position along the x axis */
margin-top: -24px !important; /* adjusts position along the y axis */
}
.future_day .marker { /* markers displayed on future day view */
margin-left: -19px !important; /* adjusts position along the x axis */
margin-top: -30px !important; /* adjusts position along the y axis */
} |
The next step is to remove the white background in the centre and to change the icon colour to allow it to be seen against the colour background.  Code Block |
---|
| .marker .pin .dot { /* white inner section of marker */
color: #fff !important; /* sets font/icon colour to white */
background: none !important; /* removes the background white colour */
} |
The final step is to adjust the position of the text popup that appears above the marker icon.  Code Block |
---|
| .today .leaflet-popup {
margin-bottom: 0 !important; /* removes additional spacers */
bottom: 38px !important; /* sets position of popup from bottom of marker */
left: -33px !important; /* sets position on the x axis relative to marker */
} |
Below is the full CSS for customising the marker icons, this can be copied into the existing Maps Stylesheet. Code Block |
---|
| /* -- custom marker drops -- */
.marker .pin {
border-radius: 50% 50% 50% 50%;
}
.today .marker {
margin-left: -13px !important;
margin-top: -24px !important;
}
.future_day .marker {
margin-left: -22.5px !important;
margin-top: -22.5px !important;
}
.marker .pin .dot {
color: #fff !important;
background: none !important;
}
.today .leaflet-popup {
margin-bottom: 0 !important;
bottom: 38px !important;
left: -33px !important;
} |
|
...