Geocoder

new Cesium.Geocoder(options)

这是一个寻找地址和地标的小工具,并将相机飞向它们。地理编码是 执行使用 Cesium ion.
Name Type Description
options object 对象,具有以下属性:
Name Type Default Description
container Element | string 将包含小部件的DOM元素或ID。
scene Scene 要使用的场景实例。
geocoderServices Array.<GeocoderService> optional 要使用的地理编码器服务
autoComplete boolean true optional 如果地理编码器应该在用户键入自动完成时进行查询,则为true
flightDuration number 1.5 optional 相机飞行到指定位置的持续时间,以秒为单位。
destinationFound Geocoder.DestinationFoundFunction GeocoderViewModel.flyToDestination optional 一个回调函数,在成功输入地理代码后调用。如果没有提供,默认行为是将相机飞到结果目的地。

Members

获取父容器。

searchSuggestionsContainer : Element

获取父容器。
获取视图模型。

Methods

销毁小部件。如果从布局中永久删除小部件, 则应该调用。

isDestroyed()boolean

Returns:
如果对象已被销毁,则为true,否则为false。

Type Definitions

Cesium.Geocoder.DestinationFoundFunction(viewModel, destination)

处理成功的地理编码结果的函数。
Name Type Description
viewModel GeocoderViewModel 视图模型。
destination Cartesian3 | Rectangle 地理编码的目标结果。
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.