- 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
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