Google Map in User control not working for multtiple instances

Joined
Feb 8, 2011
Messages
3
Reaction score
0
Hi,
I have created user control which contains google map .
code in user control is as follows
<script type="text/javascript" language="javascript">
var map;
fucntion intialize(){
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);

//set the default center
map.setCenter(myLatlng);
//set the default zoom
map.setZoom(initialZoom);

//Set the 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 to Initialize() function is from code behind(.ascx.cs) using
Me.Page.ClientScript.RegisterStartupScript(Me.GetType(), "FunctionCall", "initialize();")

Everythings works fine when single instance for user control is used in parent page (.aspx page).
But when I tried to used this user control multiple times in page ,only map for 1st instance is showing. But for other instances it is not showing anything but blank

I want to display google maps for all instances of the user control
For ex when user control is used 4 times,4 maps should be displayed

Thanks & Regards,
Anirudha Deshpande
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top