日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

6、使用infowindow

發(fā)布時間:2023/12/20 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 6、使用infowindow 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

ESRI公司提供的infowindow既美觀用實用,而且可定制性強,是時時獲取信息的好窗口,用好它可以使工作量大大的減少。

他的使用方法介紹如下:

1、 主要屬性

Property

Type

Description

anchor

String

Placement of the InfoWindow with respect to the graphic. See the Constants table for values.

Infowindow的顯示位置,具體請看其“常量“設(shè)置

coords

Point

The anchor point of the InfoWindow in screen coordinates.

信息窗口所在的坐標(biāo)點

fixedAnchor

String

InfoWindow always show with the specified anchor. See the Constants table for values.

指定的顯示位置

isShowing

Boolean

Determines whether the InfoWindow is currently shown on the map.

判斷信息窗口的顯示狀態(tài)

2、 常量:

ANCHOR_LOWERLEFT

窗口位于點的左下

ANCHOR_LOWERRIGHT

InfoWindow is anchored to the lower right of the point. 右下

ANCHOR_UPPERLEFT

InfoWindow is anchored to the upper left of the point.左上

ANCHOR_UPPERRIGHT

InfoWindow is anchored to the upper right of the point.右上

3、 方法:

Method

Return Value

Description

hide()

none

隱藏信息窗口

move(point)

none

Moves the InfoWindow to the specified screen point.

移動信息框到指定點

resize(width, height)

none

Resizes the InfoWindow to the specified height and width in pixels.改變信息框大小

setContent(stringOrDOMNode)

InfoWindow

Sets the content in the InfoWindow.設(shè)置信息窗口的內(nèi)容

setFixedAnchor(anchor)

none

Sets the fixed location of the InfoWindow anchor. Valid values are listed in the Constants table.設(shè)置顯示位置

Anchor參數(shù)為上面的常量類型

setTitle(title)

InfoWindow

Sets the title for the InfoWindow.

設(shè)置窗口的標(biāo)題

show(point, anchor)

none

Shows the InfoWindow at the specified screen point and anchor. Valid values are listed in the Constants table.

顯示信息框(位置點,位置)

4、 事件:

onHide()

隱藏窗口時的事件

onShow()

顯示窗口時的事件

5、 使用實例:

function infowindow(evt) { map.infoWindow.setTitle("Coordinates"); map.infoWindow.setContent("lat/lon : " + evt.mapPoint.y + ", " + evt.mapPoint.x + "<br />screen x/y : " + evt.screenPoint.x + ", " + evt.screenPoint.y); map.infoWindow.show(evt.screenPoint,map.getInfoWindowAnchor(evt.screenPoint)); } map.getInfoWindowAnchor(evt.screenPoint); //為獲取系統(tǒng)建議的顯示位置,這樣寫可以使窗口盡量顯示在屏幕中最佳位置!!

?

轉(zhuǎn)載于:https://www.cnblogs.com/dwf07223/archive/2013/04/27/3048095.html

總結(jié)

以上是生活随笔為你收集整理的6、使用infowindow的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。