zoukankan      html  css  js  c++  java
  • leaflet地图在选项卡中不正常显示

    可以在选项卡中加个click事件,调用下

    <a href="#tab1" >tab1</a>
    <a href="#tab2" onclick="$.expandMap();">tab2</a
    >
    
    
    var map = null;
    $(function(){
    //加载gis地图
    var southWest = L.latLng(*, *),
    northEast = L.latLng(*, *),
    bounds = L.latLngBounds(southWest, northEast);

    map = L.map('ExampleMap', {
    zoomControl: true,
    attributionControl: false,//隐藏copyright
    maxBounds: bounds,
    minZoom: 9,
    maxZoom: 12,
    invalidateSize:true
    }).setView([*, *], 9);
    console.log('test');
    new L.TileLayer.TileLoad('./maps/NJBaseMap').addTo(map);
    })


    $.expandMap = function() {
    L.Util.requestAnimFrame(map.invalidateSize,map,!1,map._container);
    }
     
     
  • 相关阅读:
    表达式for loop
    用户输入
    字符编码
    变量字符编码
    Python安装
    Python 2 or 3?
    Python解释器
    2017中国大学生程序设计竞赛
    Educational Round 27
    Round #429 (Div.2)
  • 原文地址:https://www.cnblogs.com/alaric888/p/6272440.html
Copyright © 2011-2022 走看看