类型 布尔 事件 mapLocation 版本 版本 2024.3703 关键词 mapLocation, isError
指示服务器返回错误而不是位置。
通常情况下这将是 false
,但在错误情况下它将为 true
(并且其他事件属性将为空)。 event.errorMessage 将包含描述错误的字符串。
local function mapLocationHandler( event ) -- handle mapLocation event here if event.isError then print( "Error: " .. event.errorMessage ) else print( "The specified string is at: " .. event.latitude .. ", " .. event.longitude ) end end myMap:requestLocation( "1900 Embarcadero Road, Palo Alto, CA", mapLocationHandler )