关于geoserver 地图鼠标滑动事件更改样式及比例尺中文

—–鼠标滑动时间原来样式 xxx.xxx,xx,xxx 改编成 经度:xxx.xxx  纬度xx.xxx

 

 //map.addControl(new OpenLayers.Control.MousePosition({element: $('location')}));

map.events.register("mousemove", map, function(e) { 
        var position = this.events.getMousePosition(e);
        var lonlat = map.getLonLatFromPixel(position);
        OpenLayers.Util.getElement("coords").innerHTML ="经度:"+lonlat.lon+"  纬度:"+lonlat.lat;
    });

 

—–把 Scale = 1:55M 改成 比例尺 = 1:55M

 

  修改OpenLayers.js 文件里的

  “OpenLayers/Lang/en.js”

  “OpenLayers/Lang/zh-CN.js”

     关联文件 

   OpenLayers.js

   Scale.js

转载自:https://blog.csdn.net/groovylc/article/details/84167594

You may also like...