Code Monkey home page Code Monkey logo

Comments (4)

 avatar commented on August 15, 2024

The problem is somewhere between lines 587 and 602. I am not sure where as I don't understand what's happening there. But removing those lines helped.

// Update the icon property
if (data.icon === undefined || data.icon === null || typeof data.icon !== 'object') {
    // If there is no icon property or it's not an object
    if (old_data.icon !== undefined && old_data.icon !== null && typeof old_data.icon === 'object') {
        // If there was an icon before restore to the default
        marker.setIcon(new DefaultLeafletIcon());
    }
} else if (old_data.icon === undefined || old_data.icon === null || typeof old_data.icon !== 'object') {
    // The data.icon exists so we create a new icon if there wasn't an icon before
    marker.setIcon(new DefaultLeafletIcon(data.icon));
} else {
    // There is an icon and there was an icon so if they are different we create a new icon
    if (JSON.stringify(data.icon) !== JSON.stringify(old_data.icon)) {
        marker.setIcon(new DefaultLeafletIcon(data.icon));
    }
}

from angular-leaflet-directive.

JaumeFigueras avatar JaumeFigueras commented on August 15, 2024

Hi,
I can't reproduce the issue you report. In the examples folder there is the option to set an 'other' icon and the draggable property to true. Then I drag the marker and the icon does not change (I'm using FF23).
The code you are showing is the update of the properties of the marker. So if you change or remove the icon properties of the marker model, it gets updated. Removing the icon properties in the marker sets the default icon again. Are you removing the icon properties of your marker?

from angular-leaflet-directive.

JaumeFigueras avatar JaumeFigueras commented on August 15, 2024

Mmmmm.... I missed that awesome is a plugin
OK. the problem is simple. Leaflet.Icon constructor can't initialize an icon with an object, only options. So when passing a new object Leaflet can't initialize it correctly.
The directive, at this moment only supports Leaflet, so only icons created using the Leaflet API will work.
As, at this moment, I'm adding support for layer plugins, I will try to add also support for Awesome Icon Plugin.

from angular-leaflet-directive.

JaumeFigueras avatar JaumeFigueras commented on August 15, 2024

Solved in #119

from angular-leaflet-directive.

Related Issues (20)

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.