zoukankan      html  css  js  c++  java
  • 在任务栏显示地理坐标

    function OnPageLoad() {

    ...

    map.AttachEvent("oninit", MapInit());

    map.Init();

    }

     function MapInit() {

     //在任务栏显示地理坐标

      ShowMapCoord();  

    }

     function ShowMapCoord() {

       var action = new ShowMapCoordAction();

       map.SetAction(action);

     }

    function ShowMapCoordAction() {

        this.type = "SuperMap.IS.MapCoordAction";

        this.Init = function(mapControl) {

        this.mapControl = mapControl;

        if (_ygPos.browser == "ie") 

         { mapControl.container.style.cursor = _scriptLocation + "../images/cur_PointQuery.cur"; }

        else 

         { mapControl.workLayer.style.cursor = "url(images/cur_PointQuery.cur),auto"; };

       };

         this.Destroy = function() { this.mapControl = null; };

         this.OnClick = function(e) { };

         this.OnDblClick = function(e) { };

         this.OnMouseMove = function(e) { window.status = "当前坐标 X=" + e.mapCoord.x + "  Y=" + e.mapCoord.y };

         this.OnMouseDown = function(e) { };

         this.OnMouseUp = function(e) { };

         this.OnContextMenu = function(e) { };

         this.GetJSON = function() { return _ActionToJSON(this.type, []); }

    }

    注意:要想让任务栏一直都能显示出坐标来,包括在放大、缩小的时候,那么需要在放大缩小的OnMouseMove事件中都添加上{ window.status = "当前坐标 X=" + e.mapCoord.x + "  Y=" + e.mapCoord.y }

  • 相关阅读:
    gitLab、docker
    Spring源码分析
    Tomcat堆内存分析
    Kafka入门一
    Java NIO
    spring注解
    websocket即时通讯
    pycharm安装dlib库
    python+opencv人脸识别是否戴口罩
    2021年暑假周总结1
  • 原文地址:https://www.cnblogs.com/myparamita/p/1947679.html
Copyright © 2011-2022 走看看