Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marker is not rendered when using custom icon #3

Closed
Powerhamster opened this issue Nov 1, 2018 · 2 comments
Closed

Marker is not rendered when using custom icon #3

Powerhamster opened this issue Nov 1, 2018 · 2 comments
Assignees
Labels
Milestone

Comments

@Powerhamster
Copy link

When creating the icon for the marken an exception is throw

TypeError: this.callInitHooks is not a function

It can be solved by using new when creating the icon.

public function encodeIcon(ImageIcon $icon, Encoder $encoder)
    {
        return sprintf(
            '%s = new L.Icon(%s);',
            $encoder->encodeReference($icon),
            $encoder->encodeArguments(array($icon->getOptions()))
        );
    }
@dmolineus dmolineus self-assigned this Nov 1, 2018
@dmolineus dmolineus added the bug label Nov 1, 2018
@dmolineus dmolineus added this to the 1.0.4 milestone Nov 1, 2018
@dmolineus
Copy link
Member

Yeah, it should use the factory methods Leaflet provides L.icon and L.divIcon. Never stumpled upon it because of using a custom implementation for custom icons.

dmolineus added a commit that referenced this issue Nov 1, 2018
@dmolineus
Copy link
Member

Fixed in Version 1.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants