On Oct 25, 4:39 pm, Sterling <[email protected]> wrote:
> Hello, I am trying to publish a web site, which contains some markers
> exported from the database to a xml document. The web should show the
> markers but it doesn´t. In my local server it does, but I uploaded the
> page to my ftp server, and then the markers dont appear. Any solution?

A good start would be to read the posting guidelines (provide a link
to your map that doesn't work).

Does your server support PHP?

  -- Larry

>
> This is the code that I have:
>
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head>
>     <meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
>     <title>Google Maps</title>
> <script src="funciones.js" type="application/javascript"></script>
> <script src="http://maps.google.com/maps?
> file=api&amp;v=2&amp;sensor=true&amp;key=ABQIAAAAba06Eh2QTxXpj2LsWcuIJRTuWWC_X7m4KeSdmj2iSDlkuVVLVRTBNFzuhNhYHiyFQqH2FeDay1mAXg"
> type="text/javascript"></script>
>
> <script type="text/javascript">
>     //<![CDATA[
>     var iconBlue = new GIcon();
>     iconBlue.image = 'http://labs.google.com/ridefinder/images/
> mm_20_blue.png';
>     iconBlue.shadow = 'http://labs.google.com/ridefinder/images/
> mm_20_shadow.png';
>     iconBlue.iconSize = new GSize(12, 20);
>     iconBlue.shadowSize = new GSize(22, 20);
>     iconBlue.iconAnchor = new GPoint(6, 20);
>     iconBlue.infoWindowAnchor = new GPoint(5, 1);
>
>     var iconRed = new GIcon();
>     iconRed.image = 'http://labs.google.com/ridefinder/images/
> mm_20_red.png';
>     iconRed.shadow = 'http://labs.google.com/ridefinder/images/
> mm_20_shadow.png';
>     iconRed.iconSize = new GSize(12, 20);
>     iconRed.shadowSize = new GSize(22, 20);
>     iconRed.iconAnchor = new GPoint(6, 20);
>     iconRed.infoWindowAnchor = new GPoint(5, 1);
>
>     var customIcons = [];
>     customIcons["restaurant"] = iconBlue;
>     customIcons["bar"] = iconRed;
>
>     function load() {
>       if (GBrowserIsCompatible()) {
>         var map = new GMap2(document.getElementById("map"));
>         map.addControl(new GSmallMapControl());
>         map.addControl(new GMapTypeControl());
>         map.setCenter(new GLatLng(19.227690, -70.528824), 7);
>
>         GDownloadUrl("CrearXml.php", function(data) {
>           var xml = GXml.parse(data);
>           var provincias =
> xml.documentElement.getElementsByTagName("provincia");
>           for (var i = 0; i < provincias.length; i++) {
>             var nombre = provincias[i].getAttribute("nombre");
>                         var descripcion = 
> provincias[i].getAttribute("descripcion");
>                         var type = provincias[i].getAttribute("type");
>             var point = new
> GLatLng(parseFloat(provincias[i].getAttribute("latitud")),
>
> parseFloat(provincias[i].getAttribute("longitud")));
>             var provincia = createMarker(point, nombre, descripcion,
> type);
>             map.addOverlay(provincia);
>           }
>         });
>       }
>     }
>
>          function createMarker(point, nombre, descripcion, type) {
>       var provincia = new GMarker(point, customIcons[type]);
>       var html = nombre +  " <br/><b>"+ descripcion +"</b> <br/>";
>       GEvent.addListener(provincia, 'click', function() {
>         provincia.openInfoWindowHtml(html);
>       });
>       return provincia;
>     }
>
> function loadProvince() {
>
>         var lista = document.getElementById("opciones");
>         var indiceSeleccionado = lista.selectedIndex;
>         var opcionSeleccionada = lista.options[indiceSeleccionado];
>         var textoOpcion = opcionSeleccionada.text;
>         var valorOpcion = opcionSeleccionada.value;
>
>         var ArrayValor = valorOpcion.split(", ");
>         var latitud = ArrayValor[0];
>         var longitud = ArrayValor[1];
>         var ArrayFoto = textoOpcion.split(" ");
>         var nombreFoto = ArrayValor[2];
>         var fotografia = document.getElementById("informacion");
>         fotografia.innerHTML = "<img src=images/"+ nombreFoto + "  width=605
> height=480 >" ;
>
>       if (GBrowserIsCompatible()) {
>         var map = new GMap2(document.getElementById("map"));
>         map.addControl(new GSmallMapControl());
>         map.addControl(new GMapTypeControl());
>         map.setCenter(new GLatLng(latitud, longitud), 10);
>
>         GDownloadUrl("CrearXml.php", function(data) {
>           var xml = GXml.parse(data);
>           var provincias =
> xml.documentElement.getElementsByTagName("provincia");
>           for (var i = 0; i < provincias.length; i++) {
>             var nombre = provincias[i].getAttribute("nombre");
>                         var descripcion = 
> provincias[i].getAttribute("descripcion");
>                         var type = provincias[i].getAttribute("type");
>             var point = new
> GLatLng(parseFloat(provincias[i].getAttribute("latitud")),
>
> parseFloat(provincias[i].getAttribute("longitud")));
>             var provincia = createMarker(point, nombre, descripcion,
> type);
>             map.addOverlay(provincia);
>           }
>         });
>       }
>
>     }
>     //]]>
>   </script>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to