google maps middle of a polyline (centroid?)

后端 未结 5 893
情深已故
情深已故 2021-01-14 19:07

I have a list of polylines, just like google maps does when I click on the polyline I want an infowindow to show up just where I clicked, and it works just fine with this fu

5条回答
  •  一生所求
    2021-01-14 19:40

    Might be a bit old as well, but why not add the infobox on the click?

    infowindow.setPosition(event.latLng);
    infowindow.open(this.getMap());
    

    If it's a click that is.

提交回复
热议问题