定位获取地址coffee语法
来源:互联网 发布:我的世界瞳术js视频 编辑:程序博客网 时间:2024/05/22 06:19
#定位地图 self.locationAdd =(city) -> dialogData = { action: "", cityName:city } dialogData.dialog = ngDialog.open({ template: 'templates/line-trouble/info/location-dialog.html' className: 'ngdialog-theme-plain custom-width-70per' scope: $scope data: dialogData controller: 'GetLocationController' controllerAs: 'controller' }) dialogData.dialog.closePromise.then((data) -> if dialogData.action && dialogData.action == "confirm" && dialogData.data #self.selectedGrid = dialogData.data $scope.entity.positionAdd = dialogData.data )
angular.module "application".controller "GetLocationController", ($scope, $rootScope, $state, $stateParams, httpExecutor, userService, NgTableParams, areaService, ngDialog)-> self = @ self.ngDialogData = $scope.ngDialogData self.map = {}# 从服务端获取地图数据 self.getAllMapData = -> httpExecutor.execute('api/basis/stationLocation/list', { page: 0, size: 10000 }).then (response)-> self.mapData = response.content # self.mapData 为数组 self.renderMap()# 设置一个定时器来获取地图的 DOM, 并生成地图 mapContainerListener = setInterval(()-> if document.getElementById("bmap_container") clearInterval(mapContainerListener) self.getAllMapData() , 1000) lnglatXY = []; self.map.address ="" self.renderMap = -> self.map.mapObj = new AMap.Map('bmap_container',{resizeEnable: true,zoom:12}) # 控件 cityName =self.ngDialogData.cityName if !cityName showCityInfo = -> citysearch = new AMap.CitySearch() citysearch.getLocalCity((status,result)-> if status == 'complete' && result.info == 'OK' if result && result.city && result.bounds cityinfo = result.city citybounds = result.bounds self.map.mapObj.setBounds(citybounds) ) self.map.marker = new AMap.Marker({ map: self.map.mapObj, title:cityName, offset: new AMap.Pixel(-17, -42), draggable: true }) clickEventListener = self.map.marker.on('click',(e)-> document.getElementById("lnglat").value = e.lnglat.getLng() + ',' + e.lnglat.getLat() lnglatXY = [e.lnglat.getLng(),e.lnglat.getLat()] self.getGeocoder(lnglatXY) ) self.geocoder AMap.plugin(['AMap.ToolBar','AMap.Scale','AMap.OverView','AMap.Geocoder'],()-> self.map.mapObj.addControl(new AMap.ToolBar()) self.map.mapObj.addControl(new AMap.Scale()) self.map.mapObj.addControl(new AMap.ToolBar({locationMarker: self.map.marker})) self.geocoder = new AMap.Geocoder({ radius: 1000, extensions: "all" }) ) self.getGeocoder =(lnglatXY)-> self.geocoder.getAddress(lnglatXY,(status, result)-> if status == 'complete' && result.info == 'OK' geocoder_CallBack(result) ) geocoder_CallBack =(data)-> address = data.regeocode.formattedAddress document.getElementById("result").innerHTML = address self.map.address = address self.map.mapObj.setCity(cityName) self.map.mapObj.setFitView() self.confirm = -> $scope.ngDialogData.action = "confirm" $scope.ngDialogData.data = self.map.address # 关闭当前的 ngdialog $scope.closeThisDialog()
0 0
- 定位获取地址coffee语法
- android 获取GPS定位(原文地址)
- 获取客户端IP地址定位城市信息
- java根据IP地址获取本地定位
- 获取客户端IP地址定位城市信息
- 微信小程序如何获取手机地址定位
- php 获取公网IP地址、定位所在城市
- js获取今天时间 (coffee语句)
- Android地图获取详细街道地址信息 精确定位
- iphone中GPS精确定位及反向获取地址信息
- iphone中GPS精确定位及反向获取地址信息
- locationManager 定位地址不准,获取回调更准的方法
- 简单实用谷歌接口获取定位地址
- AngularJs 利用百度地图API 定位当前位置 获取地址信息
- 一键手机定位获取对方IP和地址信息
- 定位中获取地址位置的两种方式
- 【React Native】定位获取经纬度,当前城市等地址信息
- net/json正则表达式应用 微信定位后根据腾讯地图获取定位地址
- (100% OK)(OK) 在VirtualBox中运行 cm-13-kiwi (华为 荣耀 5X) - 移植cm-13-kiwi - 成功
- 第一个值出现一次的字符
- 面向对象思想设计_计算器小程序(设计模式入门篇_01)
- 周期性循环执行一段代码的实现
- 微信企业号,文本信息发送
- 定位获取地址coffee语法
- Win7,64位下安装Python3.5.2
- unity 四元数一些理解
- XML之基础
- studio添加Eclipse的依赖包
- Android逆向之旅---静态分析技术来破解Apk
- 关于在html中通过js解析xml相关问题:
- Service和IntentService的区别
- SAP创建客户主数据使用内部编号分配保留编号为空报错