Code Monkey home page Code Monkey logo

leaflet.iconlabel's People

Contributors

danzel avatar jacobtoye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leaflet.iconlabel's Issues

Ability to remove label events.

At the moment, the icon and label are bound to the same events. Is there a way to disable that so clicking a label won't fire the event?

Missing license

Hi,
looking through this repo, I couldn't find a license. Would be nice to make it clear what license actually applies, since I'm about to bundle a slightly modified version - something I would not be allowed to do under the default copyright laws, if I understand correctly.

Updating of labelText

Hi,
awesome work! In my project I need a dynamic changing of numbers in a marker. With this patch I can set the digit inside. But how I can change it?

I tried this:

markers[i].icon.labelText='23';

But it doesn't work ;-(

Icon position is wrong when no label present.

The issue is that the iconAnchor option is used to specify the position of the label relative to the wrapper. L.Icon uses this to offset the icon.

See pull #3 for a fix for centered icons.

IE8 "invalid argument" errors in leaflet.iconlabel.js for wrapperAnchor, labelAnchor, iconAnchor

I have implemented Leaflet.iconlabel in my site and it works fine with Chrome and Firefox but IE (specifically version 8 as that is all I have for testing) throws "invalid argument" errors on lines:

40 and 41 (this.options.wrapperAnchor.x)
79 and 80 (this.options.wrapperAnchor.x)
89 and 90 (this.options.labelAnchor.x)
99 and 100 (this.options.iconAnchor.x)

The reference to options values above is the invalid argument that I think IE was complaining about. Doing a console.log on lines 79&80 showed this.options.wrapperAnchor.x was undefined.

I resolved this by wrapping each of the line pairs in an if statement such as:

if (this.options.wrapperAnchor.x) {
    //original lines here
}

This seems to have fixed things. I'm not really sure why :-P I would have thought the values had to be defined.

Is this enough or should I create a fork? (I'm new to Github, not really sure what the process is)

Markers appear vertically offset

When adding more than one marker, the markers appear more and more vertically offset from the actual marker coordinate. This affects only the marker image, the shadow still appears in the correct location.

I have made Gist that illustrates the example, that adds ten markers to the exact same location: https://gist.github.com/3665685

This is an illustration of how this renders in my browser:

Issue screenshot

Haven't used Leaflet.iconlabel before, so I might have made some stupid mistake, but I can't see anything wrong with the code.

Ability to Change the Label Text

The label text can be updated by adding this function:

changeLabel: function (newLabel) {
this._label.innerHTML = newLabel;
},

And changing any references to label to this._label.

This is useful for using the label to show the coordinates of a marker as you drag the marker around.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.