Location class

位置信息

Constructors

Location({double? latitude, double? longitude, double? accuracy, double? altitude, double? bearing, double? speed, String? country, String? province, String? city, String? district, String? street, String? streetNumber, String? cityCode, String? adCode, String? address, String? description, String? snapshotUrl, double? zoomLevel, double? distance})
Location.fromJson(Map<String, dynamic> map)
factory
Location.fromString(String data)
factory

Properties

accuracy double
精确度
getter/setter pair
adCode String
区域编码
getter/setter pair
address String
地址信息
getter/setter pair
altitude double
海拔
getter/setter pair
bearing double
角度
getter/setter pair
city String
城市
getter/setter pair
cityCode String
城市编码
getter/setter pair
country String
国家
getter/setter pair
description String
位置语义
getter/setter pair
distance double
作为POI搜索结果的距离
getter/setter pair
district String
城镇(区)
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
latitude double
纬度
getter/setter pair
longitude double
经度
getter/setter pair
province String
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshotUrl String
作为位置消息时的截图地址
getter/setter pair
speed double
速度
getter/setter pair
street String
街道
getter/setter pair
streetNumber String
门牌号
getter/setter pair
zoomLevel double
作为位置消息时的缩放比例
getter/setter pair

Methods

buildTarget() → dynamic
使用本实例字段成员的值生成包装的目标类实例
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
转换为基本数据类型的Map。转换结果可以直接使用jsonEncode进行序列化,可以直接保存到mongo数据库
toKValues() Map<String, dynamic>
转换为用字符串key读取字段值的Map
toString() String
jsonEncode(this)抛出的异常被吃掉了,所以需要写成jsonEncode(toJson())
updateByJson(Map<String, dynamic> map, {Location? parser}) → void
通过基本数据类型的Map来更新字段。来源map可以直接使用jsonEncode进行序列化,可以直接保存到mongo数据库
updateByKValues(Map<String, dynamic> map) → void
通过用字符串key读取字段值的Map来更新字段

Operators

operator ==(Object other) bool
The equality operator.
inherited