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 }

  • 相关阅读:
    PCB打样前的注意事项
    STM32CubeMX新建工程+基本IO配置过程
    unicode gbk 转换函数
    16进制数字转换为字符
    字符转换为16进制数字
    System.IO.Directory类
    C# DataSet和DataTable详解
    DataGridView 控件详细解说
    关于Datagridview控件用法的一些总结(设置列chicun)
    获取DataGridView中的的选中行
  • 原文地址:https://www.cnblogs.com/myparamita/p/1947679.html
Copyright © 2011-2022 走看看