demos/main.js
function onHover (selection) {
        var feature = selection.feature;
        if (feature) {
            if (selection.changed) {
                var info;
                if (scene.introspection) {
                    info = getFeaturePropsHTML(feature);
                }
                else {
                    var name = feature.properties.name || feature.properties.kind ||
                        (Object.keys(feature.properties).length+' properties');
                    name = '<b>'+name+'</b>';
                    name += '<br>(click for details)';
                    name = '<span class="labelInner">' + name + '</span>';
                    info = name;
                }

                if (info) {
                    tooltip.setContent(info);
                }
            }
            layer.openTooltip(selection.leaflet_event.latlng);
        }
        else {
            layer.closeTooltip();
        }
    }
function onHover (selection) {
        var feature = selection.feature;
        if (feature) {
            if (selection.changed) {
                var info;
                if (scene.introspection) {
                    info = getFeaturePropsHTML(feature);
                }
                else {
                    var name = feature.properties.name || feature.properties.kind ||
                        (Object.keys(feature.properties).length+' properties');
                    name = '<b>'+name+'</b>';
                    name += '<br>(click for details)';
                    name = '<span class="labelInner">' + name + '</span>';
                    info = name;
                }

                if (info) {
                    tooltip.setContent(info);
                }
            }
            layer.openTooltip(selection.leaflet_event.latlng);
        }
        else {
            layer.closeTooltip();
        }
    }
function onHover ( selection ) { var feature = selection . feature ; if ( feature ) { if ( selection . changed ) { var info ; if ( scene . introspection ) { info = getFeaturePropsHTML ( feature ) ; } else { var name = feature . properties . name || feature . properties . kind || ( Object . keys ( feature . properties ) . length + ' properties' ) ; name = '<b>' + name + '</b>' ; name += '<br>(click for details)' ; name = '<span class="labelInner">' + name + '</span>' ; info = name ; } if ( info ) { tooltip . setContent ( info ) ; } } layer . openTooltip ( selection . leaflet_event . latlng ) ; } else { layer . closeTooltip ( ) ; } }
close tooltip when zooming
close tooltip when zooming