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

Markers are created, but then disappear when clicked on #22

Open
TedEwanchyna opened this issue Mar 9, 2016 · 2 comments
Open

Markers are created, but then disappear when clicked on #22

TedEwanchyna opened this issue Mar 9, 2016 · 2 comments

Comments

@TedEwanchyna
Copy link

problem: clicking on the newly created marker removes it instead of popping up
the information, for example:
Longitude: -2,94 Latitude: 33,94
Remove

My workaround:

  • have the _createNewMarker return L.marker();
    OR
  • in the options put single quotes around the values so that they are strings:
    //leaflet marker type
    markerType: 'L.marker',
    //leaflet marker properties
    markerProps: '{}'

and in _createNewMarker return the evaluated string...
_createNewMarker: function() {
// return this.options.markerType(null, this.options.markerProps);
return eval(this.options.markerType + '(null,' + this.options.markerProps + ')');
}

@TedEwanchyna
Copy link
Author

also in function collapse, don't call _ordinateLabel, call _createCoordinateLabel

<               label.innerHTML = this._createCoordinateLabel(ll);
---
>               label.innerHTML = this._ordinateLabel(ll);

@pedroetb
Copy link
Contributor

pedroetb commented May 9, 2016

I had same problem too. It's working fine at 062f759

amycomstock added a commit to amycomstock/Leaflet.Coordinates that referenced this issue Dec 4, 2016
amycomstock added a commit to amycomstock/Leaflet.Coordinates that referenced this issue Dec 4, 2016
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

No branches or pull requests

2 participants