English 中文(简体)
如何在谷歌地图上找到某种标识?
原标题:How to find a certain marker on Google Map?

我有一个表格,附有搜索结果和一系列成果标记。 每个要素都有一个识别资料,如果用户在标识上点击,则页面浏览量到搜索结果(Im 刚刚改变窗户。

是否有可能这样做? 用户点击了搜索结果,发现了一个标识的InfoWindow。

最佳回答

我假定,在地图上,发现与搜索结果有关的标记?

只要您的搜索结果有一个点击事件,其中载有你希望登上标识的一些独特的识别标志,就肯定会奏效。 目前管理的一个站点Im在搜索结果旁边,在你点击结果时,它将把标识推到地图上并显示Infowindow。 点击手援引的代码类似(有些错误处理,有些无关紧要部分回答你的问题):

function MarkerZoomTo(markerIdentifier) {
    pt = gMarkers[markerIdentifier].getPosition();
    newpt = new google.maps.LatLng(pt.lat() + .02, pt.lng());
    map.panTo(newpt);

    if (infoWindow) {
    infoWindow.close();
    }

    infoWindow.setContent(gMarkers[markerIdentifier].get( iwcontent ));
    infoWindow.setPosition(gMarkers[markerIdentifier].getPosition());

    infoWindow.open(map, gMarkers[markerIdentifier]);
}

I pass the unique marker identifier to the function, get the specific marker out of my marker array, get it s lat/lng position, create a LatLng object, and pan to that location.

其余部分只是为了找寻福炉的内容,并把它放在你认为合适的位置上。

And finally, just open the infowindow for the marker.

亲爱!

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签