leaflet 学习

1、

.info { padding: 6px 8px; font: 14px/16px Arial, Helvetica, sans-serif; background: white; background: rgba(255,255,255,0.3); box-shadow: 0 0 15px rgba(0,0,0,0.2); border-radius: 5px; } 
.info h4
{ margin: 0 0 5px; color: #000000; }
    var info = L.control({position: 'bottomleft'});

    info.onAdd = function (map) {
        this._div = L.DomUtil.create('div', 'info');  //  create( <String> tagName, <String> className, <HTMLElement> container? )
        this.update();
        return this._div;
    };

    info.update = function (props) {
        this._div.innerHTML = '<h4>US Population Density</h4>' +  (props ?
                '<b>' + props.name + '</b><br />' + props.density + ' people / mi<sup>2</sup>'
                : 'Hover over a state');
    };

    info.addTo(map);
原文地址:https://www.cnblogs.com/unique1319/p/7201288.html