Foros del Web » Programando para Internet » Javascript »

orientacion googlemaps javascript

Estas en el tema de orientacion googlemaps javascript en el foro de Javascript en Foros del Web. maestros , tengo una duda con un script googlemaps que lee un archivo kml de mi server y muestra el mapa . el problema es ...
  #1 (permalink)  
Antiguo 11/02/2012, 13:13
Avatar de mveraa  
Fecha de Ingreso: diciembre-2002
Ubicación: santiago-chilito
Mensajes: 1.931
Antigüedad: 21 años, 3 meses
Puntos: 2
Pregunta orientacion googlemaps javascript

maestros , tengo una duda con un script googlemaps que lee un archivo kml de mi server y muestra el mapa . el problema es que no siempre puede mostrar el mapa y no entiendo el porque supongo que lentitud en algunos casos.

como poder tomar ese estado como NULO y hacer otra cosa como si el estado fue nulo intento la carga nuevamente etc.


<html>

<head>

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

<title>Google Maps JavaScript API v3 Example: Map Layers</title>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

<script type="text/javascript">

var map;



var kmlLayer = null;

var trafficLayer = null;

var bicyclingLayer = null;

var currentLayer = null;



function initialize() {

var myLatlng = new google.maps.LatLng(,);

var myOptions = {

zoom: 17,

center: myLatlng,

mapTypeId: google.maps.MapTypeId.ROADMAP

}

map = new google.maps.Map(document.getElementById("map_canva s"), myOptions);



trafficLayer = new google.maps.TrafficLayer();

bicyclingLayer = new google.maps.BicyclingLayer();

kml();

}



function traffic() {

map.setCenter(new google.maps.LatLng(,));

map.setZoom(12);

clearLayer();

trafficLayer.setMap(map);

currentLayer = trafficLayer;

}



function bicycling() {

map.setCenter(new google.maps.LatLng(,));

map.setZoom(14);

clearLayer();

bicyclingLayer.setMap(map);

currentLayer = bicyclingLayer;

}



function kml() {

url ="http://www.pipo.cl/o/f/kml/";

// document.getElementById("kmlUrl").value;

clearLayer();

kmlLayer = new google.maps.KmlLayer(url, { map: map });

currentLayer = kmlLayer;

}



function clearLayer() {

if (currentLayer != null) {

currentLayer.setMap(null);

}

}



function kmlKeyUp(e) {

var keyCode;



if (window.event) {

keyCode = window.event.keyCode;

} else if (variable) {

keyCode = e.which;

}



if (keyCode == 13) {

document.getElementById("kmlUrl").blur();

document.getElementById("kmlButton").click();

}

}

</script>

<style>

body {

font-family: sans-serif;

}



#map_canvas {

border: 1px solid black;

margin: 0px;

margin-left:0px;

}



#layers {

border: 1px solid #000088;

background-color: #e0e0e0;

width: 512px;

margin-top: 1px;



}



#heading {

font-weight: bold;

margin: 1px;

}

</style>

</head>

<body style="margin:0px; padding:0px;" onLoad="initialize()">
<div id="map_canvas" style="width:670px; height:560px"></div>



</body>

</html>


gracias por la orientacion
__________________
"Cuando se adelanta un oponente, enfréntalo y salúdalo; si intenta retroceder, déjalo seguir su camino"

Etiquetas: google, googlemaps, html, js, orientacion
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:24.