API
Component

Geolocation ($UI/system/components/justep/geolocation/geolocation)

使用范围:UI2

Contents

component Geolocation ($UI/system/components/justep/geolocation/geolocation) extends ViewComponent

<b>使用场景</b>:在组件事件(如按钮点击事件)中会增加地理位置相关操作,可实现获取位置,打开地图等功能 ## <b>文档链接</b>:#http://docs.newdao.net/appgao-ji-zu-jian/di-li-wei-zhi.html#

	
	

Constructor Top

  Geolocation ()
  Geolocation ( options)

Methods Top

void getLocation ()
void openLocationInBaiduMap ()

Operations Top

void getLocation ()
void openLocationInBaiduMap ()

Events Top

void onGetLocationFail (GetLocationFailEvent event)
void onGetLocationSuccess (GetLocationSuccessEvent event)

Constructor details Top

public Geolocation ()

<b>使用场景</b>:在组件事件(如按钮点击事件)中会增加地理位置相关操作,可实现获取位置,打开地图等功能 ## <b>文档链接</b>:#http://docs.newdao.net/appgao-ji-zu-jian/di-li-wei-zhi.html#

	
	

public Geolocation ( options)

构造函数

Inherited from ViewComponent

	
		参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
	 

Parameters

options

参数选项

Methods Detail Top

public void getLocation ()

获取地理位置信息

See GetLocation

Return Value

void

public void openLocationInBaiduMap ()

在百度地图中显示当前位置

See OpenLocationInBaiduMap

Return Value

void

Operations Detail Top

public void getLocation ()

获取地理位置信息

See GetLocation

Return Value

void

public void openLocationInBaiduMap ()

在百度地图中显示当前位置

See OpenLocationInBaiduMap

Return Value

void

Events Detail Top

public void onGetLocationFail (GetLocationFailEvent event)

[回调型事件]调用地理位置失败时触发

Parameters

GetLocationFailEvent event


结构如下:

{ 'cancel': 是否取消 (Boolean), 'data': 返回失败信息, 'source' : 当前组件 }

Return Value

void

public void onGetLocationSuccess (GetLocationSuccessEvent event)

[回调型事件]调用地理位置成功时触发

See GetLocation

Parameters

GetLocationSuccessEvent event


结构如下:

{ 'data': 返回成功信息, 'source' : 当前组件 }

Return Value

void