Skip to content

Conversation

@stefanclark
Copy link
Contributor

@stefanclark stefanclark commented Feb 28, 2017

This will allow users to add labels for route/track points which have a <name></name> set.

Configure by passing point_label_options

var xxx = new L.GPX(url, {
          async: true,
          point_label_options: {
                    regexMatch: /^(POI)/i,
                    className: 'blue'
          }
        }).addTo(map)

Example CSS

div.leaflet-marker-icon.circle.blue {
        background-color: blue;
        border-color: blue;
        border-radius: 9px;
        border-style: solid;
        border-width: 1px;
        width: 15px;
        height: 15px;
        opacity: 0.6;
        white-space: nowrap;
}

div.leaflet-marker-icon.circle.blue label {
        position: relative;
        left: 15px;
        top: -15px;
        font-weight: bold;
        text-shadow: 0 0 3px white;
}

@mpetazzoni
Copy link
Owner

I've implemented a slightly more flexible version of this with marker_options.pointMatchers (see the README for details). Thanks for the suggestion and the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants