openlayer + vue
NicoleCao
这个作者很懒,什么都没留下…
展开
-
openlayers 坐标转换
openlayers通过监听地图事件获取的经纬度坐标是经过加密算法偏移的数值,因此在使用坐标之前需要将其转化成为正确的经纬度坐标:var coordinate = map.getEventCoordinate(e);var lonlat= ol.proj.transform(coordinate ,'EPSG:3857' ,'EPSG:4326'); coordinate 是需要转化的坐标,...原创 2018-06-05 16:13:30 · 5106 阅读 · 0 评论 -
openlayers3 报错 Uncaught TypeError: M.split is not a function
问题描述:点击选中多边形区域时报错:Uncaught TypeError: M.splitis not a function换成debug的ol文件,详细错误为:UncaughtGoog.asserts.AsserttionError{message: “Assertion failed: 4th instruction should be a string”, ….} 解决方案:仔细回想,样式...原创 2018-05-31 10:41:09 · 5819 阅读 · 1 评论 -
JS如何调用VUE组件内部的方法
需求描述:有一个js文件,需要调用vue内部methods中的方法。解决方案:可以将vue中的方法当作参数传出来。案例:vue中: methods: { animation(){……}, aaa(){ jsmethod(homeThis.animation) }}JS文件:function jsmethod(animation){ if (anima...原创 2018-05-31 10:48:18 · 17214 阅读 · 10 评论 -
vue组件之间的通信及如何在父组件中调用子组件的方法和属性
声明:转载别人的,忘记地址了,本人觉得写的不错,通俗易懂且皆试验成功。在Vue中组件实例之间的作用域是孤立的,因为不能直接在子组件上引用父组件的数据,同时父组件也不能直接使用子组件的数据一、父组件利用props往子组件传输数据父组件:<div> <childv-bind:my-message="parentMsg"></child> //注意传递参数时要用—...转载 2018-05-31 10:56:57 · 688 阅读 · 0 评论