1

我在我的谷歌地图中为某些职位使用了多个 infoWindows。

但是我怎样才能避免这些信息窗口的重叠呢?是否可以使信息窗口可拖动?

提前致谢

for r_klt in c_klt
loop



htp.print('
 var geocoder = new google.maps.LatLng('||r_klt.geoloc||''||');

 var marker = new google.maps.Marker(
  {
   position: geocoder
  ,map: map
  ,animation:google.maps.Animation.DROP
  ,icon: '''||r_klt.img||'''
  ,title:" Marker: '||r_klt.MARKER_NAME||''||'"
  });

 var styles = [{stylers:[{saturation:-100}]}];
 map.setOptions({styles: styles});

 var content =  ''<div style="font-size:10px;margin-top:0px;padding-top:0px;">'||r_klt.MARKER_NAME||'<br>'||r_klt.strasse||', '||r_klt.plz||' ' ||r_klt.ort||'</div>'';

 var infowindow = new google.maps.InfoWindow();
 infowindow.setContent(content);
 google.maps.event.addListener(marker,''click'',infoCallback(infowindow, marker));

');


end loop;
4

1 回答 1

0

Infowindows are not draggable.

possible option: create a draggable marker at the infowindow's position.

Bind the position-property of the infowindow to the position-property of the marker. When you drag the marker, the infowindow will be dragged too.

Note: when you already have a marker and use this marker as 2nd argument to the open-method of the infoWindow the position will be bound automatically, you only need to make the marker draggable.

于 2013-08-19T11:11:19.397 回答