Buenos días.
Estoy migrando una aplicación .Net con VB que utiliza el api de google maps v2 al nuevo api v3. A continuación adjunto el código que estoy utilizando. La función está dentro de un control de usuario (ascx). No me sale nada, con el api v2 sale perfectamente.
Dim body As HtmlGenericControl = Me.Parent.FindControl("body")
If IsNothing(body) Then
body = Me.Parent.Parent.FindControl("body")
End If
Dim URL_HEAD_INCLUDE As String = String.Empty
Dim include As New HtmlGenericControl("script")
Dim includeGS As New HtmlGenericControl("script")
URL_HEAD_INCLUDE = URL_HEAD_INCLUDE & "http://maps.google.com/maps/api/js?sensor=false"
include.Attributes.Add("type", "text/javascript")
include.Attributes.Add("src", URL_HEAD_INCLUDE)
Page.Header.Controls.Add(include)
includeGS.Attributes.Add("type", "text/javascript")
_javascript = _javascript & "function initialize() {"
_javascript = _javascript & "var myLatlng = new google.maps.LatLng(39.980278, 4.049835);"
_javascript = _javascript & "var myOptions = {"
_javascript = _javascript & "zoom: 10,"
_javascript = _javascript & "center: myLatlng,"
_javascript = _javascript & "mapTypeId: google.maps.MapTypeId.ROADMAP,"
_javascript = _javascript & "scrollwheel: false"
_javascript = _javascript & "}"
_javascript = _javascript & "var map = new google.maps.Map(document.getElementById('map_canva s'), myOptions);"
_javascript = _javascript & "}"
includeGS.InnerText = _javascript
Page.Header.Controls.Add(includeGS)
Page.ClientScript.RegisterClientScriptInclude("goo glemaps", URL_HEAD_INCLUDE)
body.Attributes.Add("onload", "initialize();")
Agradecería si tienen alguna ayuda para resolver este problema.
Gracias.