javascript google maps api v3 - 如何在气泡内显示图像缩略图?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4514259/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 13:58:09  来源:igfitidea点击:

google maps api v3 - how to display image thumbnails inside bubble?

javascriptimagegoogle-maps

提问by Krystal

I have some thumbnails with gps info that I want to pass to a javascript google maps instance. I can get the points to draw on the map, center and zoom to fit, and I can replace the markers with the thumbnails.

我有一些带有 GPS 信息的缩略图,我想将它们传递给 javascript 谷歌地图实例。我可以获得要在地图上绘制的点,居中并缩放以适合,我可以用缩略图替换标记。

This is close, but I'm looking for something that I can style (border, size, etc) and show more of a precise location, like a popup bubble like in google maps business search.. I've looked at the chart library, but that doesn't seem to be anything more than text and their icons.

这很接近,但我正在寻找我可以设置样式(边框,大小等)并显示更多精确位置的东西,就像谷歌地图商业搜索中的弹出气泡一样......我看过图表库,但这似乎只是文本和它们的图标。

I also like the way the panoramio (when you turn on photos in a google map) will scale the majority of images down and deal with zooming.. are there public libraries or functions we can use that do this stuff?

我也喜欢 panoramio(当你在谷歌地图中打开照片时)将大部分图像缩小并处理缩放的方式......是否有我们可以使用的公共库或函数来做这些事情?

Thanks

谢谢

回答by Kai

Something like this? http://jsfiddle.net/Kai/Unh2M/embedded/result/Its using an InfoWindow to display the picture when you click on the pin.

像这样的东西?http://jsfiddle.net/Kai/Unh2M/embedded/result/当您单击图钉时,它使用 InfoWindow 来显示图片。

You can view the source on that at http://jsfiddle.net/Kai/Unh2M/and check the reference on InfoWindows at http://code.google.com/apis/maps/documentation/javascript/overlays.html#InfoWindows

您可以在http://jsfiddle.net/Kai/Unh2M/查看源代码,并在http://code.google.com/apis/maps/documentation/javascript/overlays.html#InfoWindows查看 InfoWindows 上的参考