zoukankan      html  css  js  c++  java
  • TypeError:this.K is undefined

    1、错误描述



    2、错误原因

    <!DOCTYPE html>
    <html>
      <head>
        <title>设置地图最小、最大级别</title>
    	
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="this is my page">
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ak密钥"></script>
    	<style>
    		body{
    		    100%;
    		   height: 100%;
    		   overflow: hidden;
    		   font-family: "微软雅黑";
    		   margin: 0;
    		}
    		#minMaxMap{
    		    100%;
    		   height: 100%;
    		   margin: 0;
    		}
    	</style>
    
      </head>
      
      <body>
         <div id="minMaxMap"></div>
      </body>
    </html>
    <script>
        var map = new BMap.Map("mixMaxMap",{minZoom:1,maxZoom:12});
        map.centerAndZoom(new BMap.Point(114.309531, 30.59619),18); 
    	map.enableScrollWheelZoom(true);
    </script>

    3、解决办法

    <!DOCTYPE html>
    <html>
    <head>
    <title>设置地图最小、最大级别</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ak密钥"></script>
    <style>
    	body,html,#allmap {
    		 100%;
    		height: 100%;
    		overflow: hidden;
    		margin: 0;
    		font-family: "微软雅黑";
    	}
    </style>
    
    </head>
    <body>
    	<div id="allmap"></div>
    </body>
    </html>
    <script type="text/javascript">
        //minZoom:设置地图允许的最小级别,maxZoom:设置地图允许的最大级别
    	var map = new BMap.Map("allmap", {
    		minZoom : 1,
    		maxZoom : 18
    	}); 
    	//初始化地图,设置武汉城市
    	map.centerAndZoom(new BMap.Point(114.309531, 30.59619), 6);
    	//启用滚轮放大缩小
    	map.enableScrollWheelZoom(true);
    	//禁用地图拖拽
    	map.disableDragging(true);
    	//禁用滚轮放大缩小
    	map.disableScrollWheelZoom(true);
    	//启用键盘操作
    	map.enableKeyboard(true);
    </script>


  • 相关阅读:
    vs2015帮助文档
    算法之冒泡排序
    c++ 离散数学 群的相关判断及求解
    Entity Framwork(EF) 7——在现在数据库的甚而上开发MVC 新项目
    ASP.NET MVC 5 一 入门
    c# winform TreeView NODE(节点) 重命名或获取节点修改后的值
    xml 中转意字符&/使用方法
    entityframework 入门-来自微软
    c# 利用 两个TREEVIEW控件完成TEENODE的鼠标拖动操作
    Winform开发框架中实现多种数据库类型切换以及分拆数据库的支持
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13314196.html
Copyright © 2011-2022 走看看