Hi, I'm a newbie in Google Maps, amateur in Flex.

I want to replicate your article Using PHP/MySQL with the Google Maps
API for Flash. When create the PHP service everything is fine, look:
http://www.ubika.cl/turisvino/getvinas.php

But, i don't see the markers. What's my problem?

Thank u very much for your help.

German Labrana

This is my code:

<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright 2008 Google Inc.
 Licensed under the Apache License, Version 2.0:
   http://www.apache.org/licenses/LICENSE-2.0
-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
 width="100%" height="100%" layout="absolute" viewSourceURL="srcview/
index.html">
 <mx:Panel title="Xml Parsing with Google Maps Demo" width="100%"
height="100%">
 <mx:UIComponent id="mapHolder"
     initialize="onHolderCreated(event);"
     resize="onHolderResized(event)"
     width="100%" height="100%"/>
 </mx:Panel>
 <mx:Script>
   <![CDATA[
     import com.google.maps.Map;
     import com.google.maps.LatLng;
     import com.google.maps.LatLngBounds;
     import com.google.maps.MapEvent;
     import com.google.maps.MapMouseEvent;
     import com.google.maps.MapType;
     import com.google.maps.InfoWindowOptions;
     import com.google.maps.overlays.Marker;
     import com.google.maps.overlays.MarkerOptions;
     import com.google.maps.controls.ZoomControl;
     import mx.controls.Alert;

     // Para el marker
     import com.google.maps.styles.FillStyle;
     import com.google.maps.styles.StrokeStyle;

     private var map:Map;

   /*  [Embed(source="data/blue-dot.png")] private var
blueIcon:Class;
     [Embed(source="data/green-dot.png")] private var
greenIcon:Class;
     private var customIcons:Object =
       { "restaurant": blueIcon,
         "bar": greenIcon
       };
   */
     public function onHolderCreated(event:Event):void {
       map = new Map();
       map.key =
"ABQIAAAAHw7AniXLjfhvcMhHBLyRfhTUJLvmVBjPcv9hiihqukyl1jWR1RQgWvsTWrguSun9sTuY0kFsxfyQGg";
       map.addEventListener(MapEvent.MAP_READY, onMapReady);
       mapHolder.addChild(map);
     }

     public function onHolderResized(event:Event):void {
       map.setSize(new Point(mapHolder.width, mapHolder.height));
     }

     private function onMapReady(event:Event):void {
       map.enableScrollWheelZoom();
       map.enableContinuousZoom();
       map.setCenter(new LatLng(-34.3055, -70.7545), 8);
       map.addControl(new ZoomControl());
       getXml();
    }

    public function getXml():void {
        var xmlString:URLRequest = new URLRequest("http://
www.ubika.cl/turisvino/getvinas.php");
         var xmlLoader:URLLoader = new URLLoader(xmlString);
         xmlLoader.addEventListener("Completado", readXml);
   }

   public function readXml(event:Event):void{
       var markersXML:XML = new XML(event.target.data);
       var markers:XMLList = markersXML..marker;
       var markersCount:int = markers.length();
       var i:Number;
       for (i=0; i < markersCount; i++) {
           var markerXml:XML = markers[i];
           var name:String = markerx...@nombre;
           var address:String = markerx...@direccion;
           var desc:String = markerx...@descripcion;
           var latlng:LatLng = new LatLng(markerx...@lat,
markerx...@lon);
           var marker:Marker = createMarker(latlng, name, address,
desc);
           map.addOverlay(marker);
       }
   }


     public function createMarker(latlng:LatLng, name:String,
address:String, desc:String): Marker {
       var marker:Marker = new Marker(latlng, new MarkerOptions
({strokeStyle: new StrokeStyle({color: 0x987654}), fillStyle: new
FillStyle({color: 0x223344, alpha: 0.8}), radius: 12, hasShadow:
true}));
       var html:String = "<b>" + name + "</b> <br/>" + address + "<br/
>" + desc;
       marker.addEventListener(MapMouseEvent.CLICK, function
(e:MapMouseEvent):void {
         marker.openInfoWindow(new InfoWindowOptions
({contentHTML:html}));
       });
       return marker;
    }

   ]]>
 </mx:Script>
</mx:Application>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" group.
To post to this group, send email to google-maps-api-for-flash@googlegroups.com
To unsubscribe from this group, send email to 
google-maps-api-for-flash+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to