以特定的经度/纬度浮点Google地图上的Div [英] Float a Div over Google Maps at specific lat / lng
问题描述
我正在尝试使用地图构建Web应用程序的前端。我真的想在特定的lat / lng位置浮动div。我不能按像素做,因为这不会影响屏幕尺寸在不同屏幕上变化。
I am trying to build the front end to a web app with a map. I really want to float a div at a specific lat / lng location. I can not do it by pixel as this will not account for screen size changing on different screens.
有没有人做过这个,我想我需要读取lat长的位置,看看屏幕上的位置,然后更新CSS让div正确定位。
Has anyone done this before, I think I would need to read the lat long location and see where is in on the screen, then update the css to allow the div to be positioned correctly.
可以使用覆盖视图。
https://developers.google.com/maps/documentation/javascript / reference#OverlayView
You can use an Overlay View. https://developers.google.com/maps/documentation/javascript/reference#OverlayView
请参阅Google示例:
https://google-developers.appspot.com/maps/documentation/javascript/examples/overlay-simple
See the Google example here: https://google-developers.appspot.com/maps/documentation/javascript/examples/overlay-simple
这篇关于以特定的经度/纬度浮点Google地图上的Div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!