javascript - Google Map in User control not working for multtiple instances -


i have created user control contains google map . code in user control follows

<script type="text/javascript" language="javascript"> var map; function intialize(){   map = new google.maps.map(document.getelementbyid("map_canvas"), mapoptions);          //set default center        map.setcenter(mylatlng);         //set default zoom        map.setzoom(initialzoom);          //set map type        map.setmaptypeid(google.maps.maptypeid.satellite); } </script>  html code: <div id="map_canvas" style="float: left; width: 100%; height: 300px; border: solid 1px black;" > </div> 

call initialize() function code behind(.ascx.cs) using me.page.clientscript.registerstartupscript(me.gettype(), "functioncall", "initialize();")

everythings works fine when single instance user control used in parent page (.aspx page). when tried used user control multiple times in page ,only map 1st instance showing. other instances not showing blank

i want display google maps instances of user control ex when user control used 4 times,4 maps should displayed

the first thing try generating unique id each div element.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -