Google maps; add place card to marker

前端 未结 2 1545
感情败类
感情败类 2020-12-06 10:49

As you can see on the following image, the div (top left) shows the current marker address/directions/ save..

相关标签:
2条回答
  • 2020-12-06 11:50

    jsbin with my solution

    Background:

    I needed a better solution to the mouse wheel scroll problem here and here. The best way to get the behaviour I wanted was to stick with the API, but I really like the card shown in the embedded version.

    Method:

    1. Copied card code and associated css from embedded version.
    2. In javascript, append card html into the rendered map when it's ready

    My Customizations:

    1. Took off the "Save" option because it doesn't work.
    2. Positioned card on the top right - look at the html that is appended in javascript, it's hardcoded with absolute position, you can change this or associate it with a class if you prefer.

    Hope this works for you!

    0 讨论(0)
  • 2020-12-06 11:51

    I added second map in @jcsmesquita answer but there are same place cards on two maps : http://jsbin.com/vixehodaka/edit?html,css,js,output

    so I changed javascript code a bit : jsbin.com/dezorezohe/edit?html,css,js,output

    0 讨论(0)
提交回复
热议问题