123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- /**
- * 应用唯一全局对象
- * @namespace ONEMAP
- * @type {*|Object}
- */
- var ONEMAP = ONEMAP || {}; //全局变量
- /**
- * 模块对象
- * @namespace ONEMAP.M
- * @type {Object}
- */
- ONEMAP.M = {}; //模块
- /**
- * 视图对象
- * @namespace ONEMAP.V
- * @type {Object}
- */
- ONEMAP.V = {}; //视图
- /**
- * 管理对象
- * @namespace ONEMAP.C
- * @type {Object}
- */
- ONEMAP.C = {}; //管理
- /**
- * 共用工具对象
- * @namespace ONEMAP.T
- * @type {Object}
- */
- ONEMAP.T = {}; //共用
- /**
- * 数据对象
- * @namespace ONEMAP.D
- * @type {Object}
- */
- ONEMAP.D = {}; //数据
- //专题图数据
- ONEMAP.D.Thematic = {};
- //地图显示专题图数据集
- ONEMAP.D.ThematicInMapData = {};
- //浏览器类型
- ONEMAP.M.liuLanQi = "";
- //自定义重要目标与事件
- ONEMAP.M.diyData = "";
- //require 配置
- require.config({
- baseUrl: "./",
- waitSeconds: 25,
- urlArgs: "v=" + onemapVersion,
- paths: {
- text: "scripts/vendor/require/text",
- html: "scripts/vendor/require/html",
- css: "scripts/vendor/require/css",
- image: "scripts/vendor/require/image",
- async: "scripts/vendor/require/async",
- font: "scripts/vendor/require/font",
- modDir: "scripts/mod",
- meteoDir:"scripts/meteo",
- layoutDir: "scripts/layout",
- vendorDir: "scripts/vendor"
- }
- });
- require([''],
- function(update) {
- // alert(222);
- $.ajaxSetup({ cache: false });
- //系统初始化离线或在线
- if(map23DConfig.netType == 1){
- $.each(map23DConfigIntranet,function(i,t){
- map23DConfig[i] = t
- })
- $.each(onemapUrlConfigIntranet,function(i,t){
- onemapUrlConfig[i] = t
- })
- }else{
- $.each(map23DConfigNetwork,function(i,t){
- map23DConfig[i]= t
- })
- $.each(onemapUrlConfigNetwork,function(i,t){
- onemapUrlConfig[i] = t
- })
- }
- $(function(){
- var map = L.map('mapHolder',{
- center:[39,116],
- zoom:4
- })
- L.tileLayer(map23DConfig.tileServerUrl+'/gr?l={z}&x={x}&y={y}', {
- minZoom:1,
- maxZoom:19,
- subdomains:'123456789'
- }).addTo(map);
- L.tileLayer(map23DConfig.tileServerUrl+'/go?l={z}&x={x}&y={y}', {
- minZoom:1,
- maxZoom:19,
- subdomains:'123456789'
- }).addTo(map);
- var zoom = $("<div class='zoomControl'>"+map.getZoom()+"</div>");
- zoom.appendTo($("#mapHolder .leaflet-control-zoom"));
- $("#tiShiGengXin").show();
- $("#update .close").bind("click",function(){
- $("#update").hide();
- })
- $("#updateWin7 .close").bind("click",function(){
- $("#updateWin7").hide();
- })
- $("#tiShiGengXin a").bind("click",function(){
- $(".updateV").show();
- })
- //ie6-8 避免不兼容..
- $(".baseSatellite").bind("click",function(){
- $(".leaflet-layer").remove();
- L.tileLayer(map23DConfig.tileServerUrl+'/gr?l={z}&x={x}&y={y}', {
- minZoom:1,
- maxZoom:19,
- subdomains:'123456789'
- }).addTo(map);
- L.tileLayer(map23DConfig.tileServerUrl+'/go?l={z}&x={x}&y={y}', {
- minZoom:1,
- maxZoom:19,
- subdomains:'123456789'
- }).addTo(map);
- })
- $(".baseTerrain").bind("click",function(){
- $(".leaflet-layer").remove();
- L.tileLayer(map23DConfig.tileServerUrl+'/gt?l={z}&x={x}&y={y}', {
- minZoom:1,
- maxZoom:19,
- subdomains:'123456789'
- }).addTo(map);
- })
- $(".baseStreet").bind("click",function(){
- $(".leaflet-layer").remove();
- L.tileLayer(map23DConfig.tileServerUrl+'/gm?l={z}&x={x}&y={y}', {
- minZoom:1,
- maxZoom:19,
- subdomains:'123456789'
- }).addTo(map);
- })
- map.on("zoomend",function(e){
- $(".zoomControl").text(map.getZoom());
- })
- })
-
- });
|