ui-leaflet icon indicating copy to clipboard operation
ui-leaflet copied to clipboard

markers / label drawing on the screen

Open vvavepacket opened this issue 9 years ago • 1 comments

Let's say we have a marker with label. Where in the code can we modify it in such a way, we can add css properties just before they are rendered on screen? Basically, when the markers and label are rendered in screen, they should have already the custom css properties in them... As of now, I can add css properties after they are loaded,, but I want to do it before,, so that user's will see the change immediately. Any best approches/best practice? Thank you.

vvavepacket avatar Feb 04 '17 00:02 vvavepacket

There's an "options" property for labels, where you can use "className" define the css class to add to the label element. Is that what you're looking for?

markers: {
  main_marker: {
    lat: 0,
    lng: 0,
    focus: true,
    title: "Marker",
    draggable: true,
    label: {
      message: "I'm a label",
      options: {
        className: "my-class-name"
      }
    }
  }
}

BAByrne avatar Feb 16 '17 14:02 BAByrne