Hi Akmal-

I don't see where your code calls getXml(). You should put trace
statements in to see where your code actually reaches, and use error
events on URLLoader to see if there are network issues. This will help
you debug your code.

- pamela

On Mon, Jun 8, 2009 at 6:02 PM, Akmal<[email protected]> wrote:
>
> Dear Friends,
>   I was trying to add markers from mysql database as shown here:
> http://code.google.com/apis/maps/articles/phpsqlflex.html
>
> The compiled sample works fine, but when I copied code fragments to my
> application its not displaying markers. Can you help me to find the
> reason of the problem?
>
> original project: http://max.uz/karta/karta.html
> my compiled project is here: http://max.uz/karta/hello.html
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="absolute">
> <maps:Map xmlns:maps="com.google.maps.*" id="map"
> mapevent_mapready="onMapReady(event)" width="100%" height="100%"
> key="ABQIAAAAZdQQOfS8l_rF0-
> rRRwyzjBSc61ivnUBnrG4Zgq_VX0Xa4JUGyhTsUfugJTMGb3yV4T1ltUnimXLoag"/>
> <mx:Script>
>    <![CDATA[
>
>    import com.google.maps.LatLng;
>    import com.google.maps.Map;
>    import com.google.maps.MapEvent;
>    import com.google.maps.MapType;
>    import com.google.maps.controls.MapTypeControl;
>    import com.google.maps.*;
>    import com.google.maps.controls.*;
>    import com.google.maps.interfaces.*;
>    import com.google.maps.overlays.*;
>    import com.google.maps.services.*;
>    import com.google.maps.styles.*;
>    import mx.controls.Alert;
>    import com.google.maps.InfoWindowOptions;
>    import com.google.maps.overlays.Marker;
>    import com.google.maps.overlays.MarkerOptions;
>    import com.google.maps.MapMouseEvent;
>
>
>        [Embed(source="../images/icon1.png")] private var blueIcon:Class;
>    [Embed(source="../images/icon2.png")] private var greenIcon:Class;
>      private var customIcons:Object =
>        { "restaurant": blueIcon,
>          "bar": greenIcon
>        };
>     //zoom rate (change here)
>   private var zoomRate:Number = 1;
>
>
>    private function onMapReady(event:Event):void {
>      map.setCenter(new LatLng(41.326072,69.242062), 14,
> MapType.NORMAL_MAP_TYPE);
>      map.addControl(new ZoomControl());
>      map.addControl(new PositionControl());
>      map.addControl(new MapTypeControl());
>
>      map.continuousZoomEnabled();
>      map.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel);
>    }
>
>    private function onMouseWheel(e:MouseEvent):void{
>     var zoom:Number = map.getZoom();
>     if(e.delta>0){
>       map.setZoom(zoom+zoomRate);
>     }else{
>       map.setZoom(zoom-zoomRate);
>     }
>   }
>    public function getXml():void {
>  var xmlString:URLRequest = new URLRequest("http://max.uz/karta/
> phpgen.php");
>  var xmlLoader:URLLoader = new URLLoader(xmlString);
>  xmlLoader.addEventListener("complete", readXml);
> }
>        public function readXml(event:Event):void {
>  var markersXML:XML = new XML(event.target.data);
>  var markers:XMLList = markersXML..marker;
>  for (var i:Number = 0; i < markers.length(); i++) {
>    var marker:XML = markers[i];
>    var name:String = mark...@name;
>    var address:String = mark...@address;
>    var type:String = mark...@type;
>    var latlng:LatLng = new LatLng(mark...@lat, mark...@lng);
>    var marker = createMarker(latlng, name, address, type);
>    map.addOverlay(marker);
>  }
> }
>    public function createMarker(latlng:LatLng, name:String,
> address:String, type:String): Marker {
>          var marker:Marker = new Marker(latlng, new MarkerOptions
> ({icon: new customIcons[type], iconOffset: new Point(-16, -32)}));
>        var html:String = "<b>" + name + "</b> <br/>" + address;
>        marker.addEventListener(MapMouseEvent.CLICK, function
> (e:MapMouseEvent):void {
>          marker.openInfoWindow(new InfoWindowOptions
> ({contentHTML:html}));
>        });
>        return marker;
>     }
>  //bu funtsiya kup markerlar bulsa tulib ketmasligi uchun karta
> ayrimlarini zoom levelga qarab hide qiladi http://www.marcusschiesser.de/?p=87
>  //private function calcMinZoomLevel(marker:Marker):Number {
>  // var mPoint:LatLng = marker.getLatLng();
>  // for(var zoom:Number = 1; zoom<map.maxZoom_; zoom++) {
> //    var gridPoint:Point = map.getTilePoint_(mPoint, zoom, new Point
> (0, 0));
> //    var cell:Array = map.getGridCellNoCreate_(gridPoint.x,
> gridPoint.y, zoom);
> //    if(cell==null)
> //      return zoom;
> //  }
> //  return maxZoom_;
> //}
>
>    ]]>
> </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 [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-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to