Administrator hace 2 años
padre
commit
b598c5ecc9

+ 0 - 1
src/main/java/com/sysu/admin/api/user/ApiUserController.java

@@ -59,7 +59,6 @@ public class ApiUserController extends BaseComponent {
             }
             return R.succ(getUser(sms.getCode(), sms.getMobile()));
         }
-
     }
 
     private User getTokenUser(String token){

+ 13 - 0
src/main/java/com/sysu/admin/site/CommonVo.java

@@ -0,0 +1,13 @@
+package com.sysu.admin.site;
+
+import lombok.Data;
+
+@Data
+public class CommonVo {
+    private Integer code;
+    private Integer level;
+    private Double x1;
+    private Double y1;
+    private Double x2;
+    private Double y2;
+}

+ 45 - 0
src/main/java/com/sysu/admin/site/SiteCfgController.java

@@ -0,0 +1,45 @@
+package com.sysu.admin.site;
+
+import com.alibaba.fastjson.JSON;
+import com.sysu.admin.support.system.config.SConfig;
+import com.sysu.admin.support.system.config.SConfigService;
+import com.xiesx.fastboot.base.result.BaseResult;
+import com.xiesx.fastboot.base.result.R;
+import com.xiesx.fastboot.core.token.annotation.GoToken;
+import com.xiesx.fastboot.core.token.handle.CurrentToken;
+import lombok.Data;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RequestMapping("/site/cfg")
+@RestController
+public class SiteCfgController {
+
+    @Autowired
+    SConfigService mSConfigService;
+
+    @RequestMapping(value = "/get")
+    @ResponseBody
+    public BaseResult get(@RequestBody SConfig config,
+                          @GoToken() CurrentToken currentToken){
+        if(StringUtils.equals(SConfig.ResultType.json.name(), config.getResultType())){
+            String value = mSConfigService.getV(config.getK());
+            return R.succ("success", JSON.parseObject(value));
+        }
+        String value = mSConfigService.getV(config.getK());
+        return R.succ("success", value);
+    }
+
+    @RequestMapping(value = "/sign")
+    @ResponseBody
+    public BaseResult sign(@RequestBody SConfig config,@GoToken() CurrentToken currentToken){
+        String sldXmlJson =  mSConfigService.getV(config.getK());
+        System.out.println(sldXmlJson);
+        return R.succ("",sldXmlJson);
+    }
+
+}

+ 114 - 0
src/main/java/com/sysu/admin/site/SiteCityController.java

@@ -0,0 +1,114 @@
+package com.sysu.admin.site;
+
+import com.sysu.admin.controller.city.*;
+import com.sysu.admin.controller.crop.CropLandService;
+import com.sysu.admin.controller.crop.range.LandRangeIndexService;
+import com.sysu.admin.utils.shape.GeoCastUtil;
+import com.xiesx.fastboot.base.result.BaseResult;
+import com.xiesx.fastboot.base.result.R;
+import com.xiesx.fastboot.core.token.annotation.GoToken;
+import com.xiesx.fastboot.core.token.handle.CurrentToken;
+import org.locationtech.jts.geom.Point;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * 镇区域
+ */
+@RequestMapping("/site/city")
+@Controller
+public class SiteCityController {
+
+    @Autowired
+    ProvinceRepository provinceRepository;
+    @Autowired
+    CityRepository cityRepository;
+    @Autowired
+    DistrictRepository districtRepository;
+    @Autowired
+    LandRangeIndexService mLandRangeIndexService;
+    @Autowired
+    CropLandService cropLandService;
+
+    /**
+     * 种植结构
+     * @return
+     */
+    @RequestMapping(value = "/zzjg")
+    public String zzjg(Model model){
+        model.addAttribute("pac","441821");
+        return "page/zzjg";
+    }
+
+    @RequestMapping(value = "/findJson")
+    @ResponseBody
+    public BaseResult findJson(int code, int level){
+        Object res = null;
+        switch (level){
+            case 0:
+                Province province = provinceRepository.findByCode(code);
+                res = province;
+                if(province != null){
+                    province.setWkt(GeoCastUtil.geomToWkt(province.getGeom()));
+                }
+                break;
+            case 1:
+                City city = cityRepository.findByCode(code);
+                res = city;
+                if(city != null){
+                    city.setWkt(GeoCastUtil.geomToWkt(city.getGeom()));
+                }
+                break;
+            case 2:
+                District district = districtRepository.findByCode(code);
+                res = district;
+                if(district != null){
+                    district.setWkt(GeoCastUtil.geomToWkt(district.getGeom()));
+                    district.setTableName(mLandRangeIndexService.getTableNameByCode(district.getCode()));
+                }
+                break;
+        }
+        return R.succ(res);
+    }
+
+    @RequestMapping(value = "/findBuffer")
+    @ResponseBody
+    public BaseResult findBuffer(@GoToken() CurrentToken currentToken, @RequestBody CommonVo commonVo){
+        Object res = null;
+        switch (commonVo.getLevel()){
+            case 0:
+                Province province = provinceRepository.findByCode(commonVo.getCode());
+                res = province;
+                if(province != null){
+                    Point point = cropLandService.getCenterPoint(province.getGeom());
+                    province.setWkt(cropLandService.getBuffer(new Double[]{point.getX(),point.getY()}, 2000));
+                }
+                break;
+            case 1:
+                City city = cityRepository.findByCode(commonVo.getCode());
+                res = city;
+                if(city != null){
+                    Point point = cropLandService.getCenterPoint(city.getGeom());
+                    city.setWkt(cropLandService.getBuffer(new Double[]{point.getX(),point.getY()}, 2000));
+                }
+                break;
+            case 2:
+                District district = districtRepository.findByCode(commonVo.getCode());
+                res = district;
+                if(district != null){
+                    Point point = cropLandService.getCenterPoint(district.getGeom());
+                    district.setWkt(cropLandService.getBuffer(new Double[]{point.getX(),point.getY()}, 2000));
+                }
+                break;
+        }
+        return R.succ(res);
+    }
+
+
+
+
+}

+ 29 - 0
src/main/java/com/sysu/admin/site/SiteLandRangeIndexController.java

@@ -0,0 +1,29 @@
+package com.sysu.admin.site;
+
+
+import com.sysu.admin.controller.crop.range.LandRangeIndexService;
+import com.xiesx.fastboot.base.result.BaseResult;
+import com.xiesx.fastboot.base.result.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+@RequestMapping("/site/range_index")
+@Controller
+public class SiteLandRangeIndexController {
+
+    @Autowired
+    LandRangeIndexService mLandRangeIndexService;
+
+    @RequestMapping("/getTableNames")
+    @ResponseBody
+    public BaseResult getTableNames(@RequestBody CommonVo commonVo){
+        String[] tableNames = mLandRangeIndexService.getTableNames(commonVo.getX1(),
+                commonVo.getY1(),
+                commonVo.getX2(),
+                commonVo.getY2());
+        return R.succ(tableNames);
+    }
+}

+ 57 - 0
src/main/java/com/sysu/admin/site/SiteUserController.java

@@ -0,0 +1,57 @@
+package com.sysu.admin.site;
+
+import com.alibaba.fastjson.JSON;
+import com.google.common.collect.Maps;
+import com.sysu.admin.support.base.BaseComponent;
+import com.sysu.admin.support.system.user_role.UserRoleService;
+import com.xiesx.fastboot.base.result.BaseResult;
+import com.xiesx.fastboot.base.result.R;
+import com.xiesx.fastboot.core.token.JwtHelper;
+import com.xiesx.fastboot.core.token.cfg.TokenCfg;
+import com.sysu.admin.support.system.role_permission.RolePermissionService;
+import com.sysu.admin.support.system.user.User;
+import com.sysu.admin.support.system.user.UserService;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+@RestController
+@RequestMapping("/site/user")
+public class SiteUserController extends BaseComponent {
+
+    @Autowired
+    UserService userService;
+    @Autowired
+    UserRoleService userRoleService;
+    @Autowired
+    RolePermissionService rolePermissionService;
+
+    @RequestMapping("login")
+    public BaseResult login(@RequestBody String data){
+        UserVo userVo = JSON.parseObject(data, UserVo.class);
+        validate(userVo);
+        // 密码加密
+        String password = DigestUtils.md5Hex(userVo.getUserName() + userVo.getPwd());
+        // 查找用户
+        User user = userService.findByUsername(userVo.getUserName());
+        // 判断密码
+        if (!password.equals(user.getPassword())) {
+           return R.fail("密码错误!");
+        }
+        BeanUtils.copyProperties(user, userVo);
+        Map<String, Object> claims = Maps.newConcurrentMap();
+        claims.put(TokenCfg.USERID, user.getId());
+        claims.put(TokenCfg.USERNAME, user.getUsername());
+        String token = JwtHelper.create("zedu", "api", claims, JwtHelper.JWT_EXPIRE_D_7);
+        userVo.setToken(token);
+        Long roleId = userRoleService.getRoleByUsers(user.getId()).stream().findFirst().get().getPk().roles();
+        userVo.setRoleId(roleId.intValue());
+        userVo.setPermissions(rolePermissionService.getPermissions(roleId));
+        return R.succ(userVo);
+    }
+}

+ 27 - 0
src/main/java/com/sysu/admin/site/UserVo.java

@@ -0,0 +1,27 @@
+package com.sysu.admin.site;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+
+@Data
+public class UserVo {
+
+    @NotBlank
+    private String userName;
+
+    @NotBlank
+    private String pwd;
+
+    private String nickname;
+
+    private Long organId;
+
+    private String token;
+
+    private Integer roleId;
+
+    private String[] permissions;
+
+}

+ 1 - 0
src/main/java/com/sysu/admin/support/cfg/ShiroCfg.java

@@ -125,6 +125,7 @@ public class ShiroCfg {
         // 匿名
         map.put("/admin/**", "anon");// 后台页面
         map.put("/api/**", "anon");// api请求
+        map.put("/site/**", "anon");// api请求
         map.put("/reg/**", "anon");// 注册
         map.put("/static/**", "anon");// 静态资源
         map.put("/images/**", "anon");// 静态资源

+ 11 - 4
src/main/java/com/sysu/admin/support/system/config/SConfig.java

@@ -8,10 +8,7 @@ import lombok.experimental.FieldNameConstants;
 import org.hibernate.annotations.DynamicInsert;
 import org.hibernate.annotations.DynamicUpdate;
 
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import javax.persistence.*;
 
 /**
  * @title Config
@@ -51,4 +48,14 @@ public class SConfig extends JpaPlusEntity<SConfig> {
 
     @Column
     private Integer sort;
+    /**
+     * 返回的value 类型 json 或 text
+     */
+    @Transient
+    private String resultType;
+
+    public enum ResultType{
+        text, json
+    }
+
 }

+ 12 - 1
src/main/java/com/sysu/admin/support/system/role_permission/RolePermissionService.java

@@ -1,5 +1,7 @@
 package com.sysu.admin.support.system.role_permission;
 
+import com.sysu.admin.support.base.BaseService;
+import com.xiesx.fastboot.core.jpa.JpaPlusRepository;
 import lombok.NonNull;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -13,7 +15,7 @@ import java.util.List;
  * @date 2020年4月24日下午10:07:21
  */
 @Service
-public class RolePermissionService {
+public class RolePermissionService extends BaseService<RolePermission, PKRP>{
 
     @Autowired
     RolePermissionRepository mRolePermissionRepository;
@@ -45,4 +47,13 @@ public class RolePermissionService {
         }
         return permissions;
     }
+
+    public List<RolePermission> getListByRole(Long roesId){
+        return mRolePermissionRepository.getListByRole(roesId);
+    }
+
+    @Override
+    public JpaPlusRepository<RolePermission, PKRP> r() {
+        return this.mRolePermissionRepository;
+    }
 }

+ 33 - 0
src/main/java/com/sysu/admin/support/system/user_role/UserRoleService.java

@@ -0,0 +1,33 @@
+package com.sysu.admin.support.system.user_role;
+
+import com.sysu.admin.support.base.BaseService;
+import com.xiesx.fastboot.core.jpa.JpaPlusRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author shu hao
+ * @description:
+ * @date 2022/5/6 15:58
+ */
+@Service
+public class UserRoleService extends BaseService<UserRole, Long> {
+
+    @Autowired
+    private UserRoleRepository mUserRoleRepository;
+
+    public UserRole getRoleByUser(Long userId){
+        return mUserRoleRepository.getRoleByUser(userId);
+    }
+
+    public List<UserRole> getRoleByUsers(Long userId){
+        return mUserRoleRepository.getRoleByUsers(userId);
+    }
+
+    @Override
+    public JpaPlusRepository<UserRole, Long> r() {
+        return this.mUserRoleRepository;
+    }
+}

+ 39 - 0
src/main/java/com/sysu/admin/support/token/GoTokenAuthenticationImpl.java

@@ -0,0 +1,39 @@
+package com.sysu.admin.support.token;
+
+import com.xiesx.fastboot.core.token.handle.GoTokenAuthentication;
+import com.sysu.admin.support.system.role_permission.RolePermission;
+import com.sysu.admin.support.system.role_permission.RolePermissionService;
+import com.sysu.admin.support.system.user_role.UserRole;
+import com.sysu.admin.support.system.user_role.UserRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class GoTokenAuthenticationImpl implements GoTokenAuthentication {
+    @Autowired
+    @Lazy
+    UserRoleService userRoleService;
+
+    @Autowired
+    @Lazy
+    RolePermissionService rolePermissionService;
+
+    @Override
+    public void authenticate(Long userId, String permission){
+        // 权限列表
+        List<UserRole> userRoles = userRoleService.getRoleByUsers(userId);
+        for (UserRole ur : userRoles) {
+            // 查询角色权限
+            List<RolePermission> rolePermissions = rolePermissionService.getListByRole(ur.getPk().roles());
+            for(RolePermission rolePermission : rolePermissions){
+                if(permission.equals(rolePermission.getPermission())){
+                    return;
+                }
+            }
+        }
+        throw new RuntimeException("没有访问权限!permission:"+permission );
+    }
+}

+ 1 - 0
src/main/resources/application.yml

@@ -36,6 +36,7 @@ fastboot:
     # 处理请求
     include-paths:
     - /api/**
+    - /site/**
     # 排除请求
     exclude-paths:
     - /static/**

+ 2 - 2
src/main/webapp/WEB-INF/jsp/base/main.jsp

@@ -21,7 +21,7 @@
 @{css}
 <!--  -->
 <script src="${base}/static/js/layuiadmin/layuiadmin/layui/layui.js"></script>
-<script src="${base}/static/js/tools/system.js"></script>
+<script src="${base}/static/package/common/system.js/js/tools/system.js"></script>
 	<script src="${base}/static/jquery/2.2.1/jquery.min.js"></script>
 	<script src="${base}/static/html5shiv/r29/html5.min.js"></script>
 	<script src="${base}/static/respond.js/1.4.2/respond.min.js"></script>
@@ -51,4 +51,4 @@
 	</div>
 </body>
 
-</html>
+</html>

+ 1 - 1
src/main/webapp/WEB-INF/jsp/comm/admin.jsp

@@ -12,7 +12,7 @@
 <html>
 <head>
 <meta charset="utf-8">
-<title>清远市裸露地表监测平台</title>
+<title>重庆市农业一张图</title>
 <meta name="renderer" content="webkit">
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 <!--UC强制全屏-->

+ 4 - 3
src/main/webapp/WEB-INF/jsp/comm/admin2.jsp

@@ -16,7 +16,8 @@
     <fb:script type="text/javascript" src='${base}/static/js/tools/styleFunction.js'></fb:script>
     <fb:script type="text/javascript" src='${base}/static/js/tools/costom.js'></fb:script>
     <fb:script type="text/javascript" src='${base}/static/js/tools/admin2.js'></fb:script>
-    <fb:script type="text/javascript" src='${base}/static/js/tools/system.js'></fb:script>
+    <fb:script type="text/javascript" src='${base}/static/package/common/system.js'></fb:script>
+    <fb:script type="text/javascript" src='${base}/static/package/common/popup.js'></fb:script>
     <fb:script type="text/javascript" src='${base}/static/js/tools/analyse.js'></fb:script>
     <fb:script type="text/javascript" src='${base}/static/timeaxis/timeAxis_new.js'></fb:script>
     <fb:css href="${base}/static/js/ztree/css/zTreeStyle/zTreeStyle.css"></fb:css>
@@ -189,7 +190,7 @@
                     <div class="label-bg general-font1 date"><img height="25" width="25" src="${base}/static/images/cloudy1.png" />星期六 2022/08/20</div>
                 </div>
                 <div class="box-center">
-                    <h1 class="general-font2 inline">重庆市</h1><h3 class="general-font1 inline">农业专题信息一张图</h3>
+                    <div><h1 class="general-font2 inline">重庆市</h1><h3 class="general-font1 inline">农业专题信息一张图</h3></div>
                 </div>
                 <div class="box-right">
                     <div class="box-right-item label-bg general-font1 logout-info">
@@ -250,4 +251,4 @@
 
         <link href="${base}/static/js/ztree/css/demo.css" rel="stylesheet"/>
     </fb:layout>
-</fb:ui>
+</fb:ui>

+ 1 - 1
src/main/webapp/static/css/admin2.css

@@ -69,7 +69,7 @@
     bottom: 0px;
     left: 0px;
     right: 0px;
-    /*background: url(../images/bg.png) no-repeat;*/
+    background: url(../images/bg.png) no-repeat;
     background-size:100% 100%;
     filter:alpha(opacity=80);
     -moz-opacity:0.8;

+ 0 - 74
src/main/webapp/static/js/tools/openLayers.js

@@ -72,81 +72,7 @@ function createGeoJson(url, sf, zIndex){
 }
 
 
-function Popup(option){
-    var that = this;
-    this.name = option.name || 'popup'
-    this.container = document.getElementById(this.name);
-    this.title = document.getElementById(this.name + '-title');
-    this.closer = document.getElementById(this.name + '-closer');
-    this.content = document.getElementById(this.name + '-content');
-    this.buttons = option.buttons || []
-    this.listener = option.listener || {}
-    this.map = option.map;
-    this.ext = {}
-    this.closer.onclick = function(){
-        that._close()
-    };
-    this.initTitleHtml(option.title)
-    this.initClick()
-    this.close = option.close || function(){}
-    //'bottom-left', 'bottom-center', 'bottom-right', 'center-left', 'center-center', 'center-right', 'top-left', 'top-center', and 'top-right'
-    this.overlay = new ol.Overlay({
-        element: this.container,
-        positioning: 'top-center',
-    });
-    map.addOverlay(this.overlay);
-}
 
-Popup.prototype = {
-    initTitleHtml(title){
-        let html = (title || "提示信息") + this.getButtonsHtml()
-        this.title.innerHTML = html;
-    },
-    getButtonsHtml(){
-        let html = ""
-        let i = 1;
-        for(let o of this.buttons){
-            html += "<button id='"+this.name+"_but_"+i+"' class='button button" + i + "'>" + o.name + "</button>"
-            i++
-        }
-        return html;
-    },
-    initClick(){
-        let that = this
-        let i = 1;
-        for(let o of this.buttons){
-            if(o.click){
-                let but =document.getElementById(this.name+"_but_"+i);
-                but.onclick = function(event) {
-                    that.listener[o.click](that, event, that.ext)
-                }
-            }
-            i++
-        }
-    },
-    show(coordinate, html, ext){
-        this.title.style.display = 'block';
-        this.overlay.setPosition(coordinate);
-        this.ext = ext || {}
-        this.flashHtml(html)
-
-    },
-    showOrHide(status){
-        this.container.style.display = status ? 'block' : 'none';
-    },
-    flashHtml(html){
-        this.content.innerHTML = html;
-        this.container.style.display = 'block';
-        this.map.renderSync();
-    }
-    ,
-    _close() {
-        this.container.style.display = 'none';
-        this.closer.blur();
-        this.close()
-        return false;
-    }
-}
 
 
 

+ 1 - 1
src/main/webapp/static/package/cityland.js

@@ -1,4 +1,4 @@
-function CityLandAction(context, id){
+function  CityLandAction(context, id){
     this.context = context
     this.id = id
     this.selected = {}

+ 75 - 0
src/main/webapp/static/package/common/popup.js

@@ -0,0 +1,75 @@
+function Popup(option){
+    var that = this;
+    this.name = option.name || 'popup'
+    this.container = document.getElementById(this.name);
+    this.title = document.getElementById(this.name + '-title');
+    this.closer = document.getElementById(this.name + '-closer');
+    this.content = document.getElementById(this.name + '-content');
+    this.buttons = option.buttons || []
+    this.listener = option.listener || {}
+    this.map = option.map;
+    this.ext = {}
+    this.closer.onclick = function(){
+        that._close()
+    };
+    this.initTitleHtml(option.title)
+    this.initClick()
+    this.close = option.close || function(){}
+    //'bottom-left', 'bottom-center', 'bottom-right', 'center-left', 'center-center', 'center-right', 'top-left', 'top-center', and 'top-right'
+    this.overlay = new ol.Overlay({
+        element: this.container,
+        positioning: 'top-center',
+    });
+    map.addOverlay(this.overlay);
+}
+
+Popup.prototype = {
+    initTitleHtml(title){
+        let html = (title || "提示信息") + this.getButtonsHtml()
+        this.title.innerHTML = html;
+    },
+    getButtonsHtml(){
+        let html = ""
+        let i = 1;
+        for(let o of this.buttons){
+            html += "<button id='"+this.name+"_but_"+i+"' class='button button" + i + "'>" + o.name + "</button>"
+            i++
+        }
+        return html;
+    },
+    initClick(){
+        let that = this
+        let i = 1;
+        for(let o of this.buttons){
+            if(o.click){
+                let but =document.getElementById(this.name+"_but_"+i);
+                but.onclick = function(event) {
+                    that.listener[o.click](that, event, that.ext)
+                }
+            }
+            i++
+        }
+    },
+    show(coordinate, html, ext){
+        this.title.style.display = 'block';
+        this.overlay.setPosition(coordinate);
+        this.ext = ext || {}
+        this.flashHtml(html)
+
+    },
+    showOrHide(status){
+        this.container.style.display = status ? 'block' : 'none';
+    },
+    flashHtml(html){
+        this.content.innerHTML = html;
+        this.container.style.display = 'block';
+        this.map.renderSync();
+    }
+    ,
+    _close() {
+        this.container.style.display = 'none';
+        this.closer.blur();
+        this.close()
+        return false;
+    }
+}

+ 0 - 0
src/main/webapp/static/js/tools/system.js → src/main/webapp/static/package/common/system.js


+ 3 - 3
src/main/webapp/static/package/geo_server_context.js

@@ -145,9 +145,9 @@ GeoServerContext.prototype = {
                 }
             }
         });
-    },bbox:undefined,
-    vectorSwitch: false
-    ,
+    },
+    bbox:undefined,
+    vectorSwitch: false,
     cacheBbox(bbox){
         this.bbox = bbox
     },changeBbox(bbox){