Jump to content

Veronica Gravino

Members
  • Content count

    63
  • Joined

  • Last visited

Community Reputation

0 Comum

2 Followers

About Veronica Gravino

  • Rank
    Veronikka
  • Birthday April 10

Informações Pessoais

  • Sexo
    Feminino
  • Localização
    São Paulo
  • Interesses
    ASP,ASP.net

Contato

  • Hangouts
    veronikka@gmail.com
  • Facebook
    https://www.facebook.com/veronica.gravino
  1. Veronica Gravino

    Google maps com repeaters nao funciona

    <asp:Literal runat='server' ID='ltrScript'></asp:Literal> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var vMostraDisponivel; var vMostraClientes; var vMostraResponsaveis; var bounds = new google.maps.LatLngBounds(); var markers; var flightPath; var map; var LocalPDV; var LocalVisita; var marker; var infowindow = new google.maps.InfoWindow(); var geocoder; var builder; function initialize() { geocoder = new google.maps.Geocoder() var myLatlng = new google.maps.LatLng(-23.5675, -46.6614); var mapOptions = { zoom: 8, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions); alert(myLatlng); var marker = new google.maps.Marker({ position: myLatlng, map: map, title: 'Responsável', icon: '../images/Ambulance_disabled.png', }); <asp:Repeater runat='server' ID='rptClientes'> <ItemTemplate> vMostraClientes = <%#iif(Eval("Latitude") <> 0, "true", "false")%>; if(vMostraClientes == true) { alert("rptClientes"); var myLatlng<%#eval("IdCliente") %> = new google.maps.LatLng(<%#replace(Eval("Latitude"), ",", ".") %>,<%#replace(Eval("Longitude"), ",", ".") %>); MostraCaminho(<%#replace(Eval("Latitude"), ",", ".") %>,<%#replace(Eval("Longitude"), ",", ".") %>); var marker<%#eval("IdCliente") %> = new google.maps.Marker({ position: myLatlng<%#eval("IdCliente") %>, map: map, icon: '../images/Hospital.png', title: " <%#Eval("Cliente") %> " }); var contentString = "<h3>CLIENTE:<%#eval("Cliente")%></h3>" ; var infowindow = new google.maps.InfoWindow({ content: contentString }); google.maps.event.addListener(marker<%#eval("IdCliente")%>, 'click', function() { infowindow.open(map,marker<%#eval("IdCliente")%>); bounds.extend(myLatlng<%#eval("IdCliente")%>); } </ItemTemplate> </asp:Repeater> <asp:Repeater runat='server' ID='rptResponsaveis'> <ItemTemplate> vMostraResponsaveis = <%#iif(Eval("Posicao") <> "", "true", "false")%>; if(vMostraResponsaveis == true) { var myLatlng<%#eval("IDDEstinatario")%>= new google.maps.LatLng<%#Eval("Posicao")%>; var marker<%#eval("IDDEstinatario")%> = new google.maps.Marker({ position: myLatlng<%#eval("IDDEstinatario")%>, map: map, icon: '../images/Ambulance.png', title:"<%#Eval("Destinatario")%> - <%#Eval("Status") %>" }); var contentString = '<div id="content">'+ '<div id="siteNotice">'+ '</div>'+ '<p> </p>'+ '<b><h3 id="firstHeading" class="firstHeading"><%#Eval("Destinatario")%> </h3></b>'+ '<div id="bodyContent">'+ '<p>_________________________________</p>'+ '<p><b>STATUS: <%#Eval("Status") %></b></p>'+ '<p><b>POSIÇÃO:<%#Eval("Posicao")%></b></p>'+ '<p>_________________________________</p>'+ '<p> </p>'+ '</div>'+ '</div>'; var infowindow<%#eval("IDDEstinatario")%> = new google.maps.InfoWindow({ content: contentString }); google.maps.event.addListener(marker<%#eval("IDDEstinatario")%>, 'click', function() { infowindow<%#eval("IDDEstinatario")%>.open(map,marker<%#eval("IDDEstinatario")%>); bounds.extend(myLatlng<%#eval("IDDEstinatario")%>); } </ItemTemplate> </asp:Repeater> map.fitBounds(bounds); map.setCenter(bounds.getCenter()); } //function TrocaIcone(vMostraDisponivel){ // var iconsel; // //alert(vMostraDisponivel); // if (vMostraDisponivel == true) // { // iconsel="../images/Ambulance.png"; // }else // { // iconsel="../images/Ambulance_disabled.png"; // } // return iconsel; //} function showMap() { alert('showMap'); google.maps.event.addDomListener(window, 'load', initialize); } function route(){ var flightPlanCoordinates = []; for(var key in markers) { flightPlanCoordinates.push(markers[key].position); } if(flightPath) { flightPath.setPath(flightPlanCoordinates); } else { flightPath = new google.maps.Polyline({ path: flightPlanCoordinates, strokeColor: "#3F48CC", strokeOpacity: 1.0, strokeWeight: 2 }); flightPath.setMap(map); } } function ClearCaminhos() { var flightPlanCoordinates = [new google.maps.LatLng(0,0),new google.maps.LatLng(0,0)]; var flightPath = new google.maps.Polyline({ path: flightPlanCoordinates, geodesic: true, strokeColor: '#3F48CC', strokeOpacity: 1.0, strokeWeight: 2 }); flightPath.setMap(null); } function MostraCaminho(lat,lon) { var flightPlanCoordinates = [new google.maps.LatLng(lat,lon)]; // alert(flightPlanCoordinates); var flightPath = new google.maps.Polyline({ path: flightPlanCoordinates, geodesic: true, strokeColor: '#3F48CC', strokeOpacity: 1.0, strokeWeight: 2 }); flightPath.setMap(null); flightPath.setMap(map); bounds = new google.maps.LatLngBounds(); var latlng = new google.maps.LatLng(lat, lon); bounds.extend(latlng); map.fitBounds(bounds); map.setCenter(bounds.getCenter()); } function removeLine() { flightPath.setMap(null); } function codeLatLng(lat,lon,cliente) { alert("CODELAT"); var lat; var lon; var latlng = new google.maps.LatLng(lat, lon); geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { map.setZoom(11); marker = new google.maps.Marker({ position: latlng, map: map, icon: '../imagens/invisivel.gif' }); var content = "<h3>CLIENTE: " + cliente + '</h3>' + "" infowindow.setContent(content) infowindow.open(map,marker) MostraCaminho(lat,lon); } else { alert('No results found'); } } else { alert('Geocoder failed due to: ' + status); } }); } google.maps.event.addDomListener(window, 'load', initialize()); //removeLine(); </script> </html> Ola Pessoal, Tenho uma pagina que está rodando o google maps na v3 Acontece que eu uso 2 repeaters dentro do javascript que recebem dados de uma procedure em SQL que é feita em vb.net Até ai ele esta recebendo estes dados normalmente, só que o mapa não carrega de forma nenhuma Será que alguém poderia me ajudar???
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.