Skip to content

Fix ReferenceError with FastMarkerCluster in layer control #866

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

Merged

Conversation

Conengmo
Copy link
Member

FastMarkerCluster was not set as a variable. So when adding it to layer control, it resulted in a ReferenceError. This PR sets it as a variable. This closes #863.

Furthermore, the callback function is included in the main function, so there is no conflict with other functions that may be called 'callback'.

I also simplified things a bit.

(function(){
var data = {{this._data}};
var map = {{this._parent.get_name()}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293 blank line contains whitespace


var {{ this.get_name() }} = (function(){
{{this._callback}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293 blank line contains whitespace

var cluster = L.markerClusterGroup();

for (var i = 0; i < data.length; i++) {
var row = data[i];
var marker = callback(row);
marker.addTo(cluster);
}

cluster.addTo(map);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293 blank line contains whitespace

@Conengmo Conengmo merged commit a33f366 into python-visualization:master Jun 6, 2018
@Conengmo Conengmo deleted the fix-fast-marker-cluster branch June 6, 2018 08:09
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.

Layer selector disappears when using FastMarkerCluster()
2 participants