javascript - set infowindow rounded corner in google map -
i have multiple marker google map, works fine want set infowindow rounded corner
and my code is:
<script type="text/javascript"> var locationlist = new array( '23.2531803, 72.4774396', '22.808782, 70.823863' ); var message = new array('kalol , gujarat , india , 382721<br /><br /> go <a href="/joomla_1.5/index.php?option=com_content&view=article&id=9:chinta-ta-ta-chita-chita-wwwsongspk&catid=1:cat1&itemid=7">kalol</a>', 'morbi , gujarat , india , 363641<br /><br /> go <a href="/joomla_1.5/index.php?option=com_content&view=article&id=9:chinta-ta-ta-chita-chita-wwwsongspk&catid=1:cat1&itemid=7">morbi</a>'); var map; var lat_min = 22.808782; var lat_max = 23.2531803; var lng_min = 70.823863; var lng_max = 72.4774396; window.onload = function() { var myoptions = { maptypeid: google.maps.maptypeid.roadmap } map = new google.maps.map(document.getelementbyid("map_canvas"), myoptions); map.setcenter(new google.maps.latlng( ((lat_max + lat_min) / 2.0), ((lng_max + lng_min) / 2.0) )); map.fitbounds(new google.maps.latlngbounds( new google.maps.latlng(lat_min - 0.01 , lng_min - 0.01), new google.maps.latlng(lat_max + 0.01, lng_max + 0.01) )); (var = 0; < locationlist.length; i++) { var args = locationlist[i].split(","); var location = new google.maps.latlng(args[0], args[1]) var marker = new google.maps.marker({ position: location, map: map, animation: google.maps.animation.drop }); var j = + 1; marker.settitle(message[i].replace(/(<([^>]+)>)/ig,"")); attachsecretmessage(marker, i); } } function attachsecretmessage(marker, number) { var infowindow = new google.maps.infowindow( { content: message[number], }); google.maps.event.addlistener(marker, 'click', function() { infowindow.open(map, marker); }); } </script> <div id="map_canvas" style="width:615px; height:400px;"></div>
the infobox constructor take parameter called boxclass
string value can set css class info box, can use customise it.
here sample:
var label1 = new infobox({ content: "<div id='label1'>1. click me! <br><small>pane: floatpane (above)</small></div>", boxclass: "labelmap label1", disableautopan: true, position: new google.maps.latlng(49.24660149427584,-123.11008930206299), closeboxurl: "", ishidden: false, pane: "floatpane" , // pane 2 enableeventpropagation: true, }); label1.setmap(_map);
Comments
Post a Comment