javascript - map.setcenter & map.setzoom not working properly -


i have left side menu bar when clicks on link, jumps marker location on map. works fine.

but, i'd update click link in left-side bar, map centers on marker , zooms level. isn't working proplerly.

the error i'm receiving in firebug is:

missing ) after argument list map.setcenter(latlng:latlng); 

code:

<div id="leftarea" style="width: 220px; float: left; border-bottom: 1px solid #dedede; padding: 5px 0 5px 0;">     <div style="color: #a41d21;font-size: 13px; font-weight: bold;">         <script language="javascript" type="text/javascript">             document.write('<a href="javascript:myclick(' + (i) + ')">' + '[[title]]' + '<\/a><br>');         </script>     </div>     <div>         [[address]]<br />         [[city]], [[state]] [[zip]]     </div> </div>  myclick = function(i) {   google.maps.event.trigger(gmarkers[i], "click"); }  // associate markers links in side bar.   gmarkers[i] = marker;  // display info window when clicks on marker or it's associated side bar link.   google.maps.event.addlistener(marker, 'click', function () {     map.setcenter(latlng:latlng);     map.setzoom(zoom: 16);     infowindow.setcontent(this.html);     infowindow.open(map, this);   }); 

map.setcenter() , map.setzoom() need specific arguments, , documentation doesn't syntax.

map.setcenter() requires latlng object:

mylatlng=  new google.maps.latlng(0,0); map.setcenter(mylatlng); 

map.setzoom() takes simple integer: example map.setzoom(16);

colons have particular use in object definitions, have no place here. causing error message.

additional issue: latlng here...?
map.setcenter(latlng:latlng);

that need defined somewhere. perhaps want map centred on marker?

map.setcenter(this.getposition());


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -