Hi RW-

Can you try something like this?

It converts a string to XML, then then searches for a LineString
element inside the string in the KML namespace. It may even be that
it's not in the KML namespace, if it's just a partial string.

var xml = new XML(roadNetworkAC.getItemAt(0));
var lineString:LineString = new LineString(xml.kml::LineString)

I hadn't imagined using the KMLParser on just partial bits of KML, but
all power to you if it works.

- pamela

On Sun, Sep 28, 2008 at 7:26 AM, RW <[EMAIL PROTECTED]> wrote:
>
> Hi There,
>
> I am experiencing a problem with type conversions. I would like to
> generate polylines on the map, by using kml generated by a database
> backend. To be more specific, I am using PostgreSQL and the PostGIS
> plugin which generates the kml strings. (I use PHP and WebORB to
> deliver these kml strings to the flex application)
>
> I am able to generate a kml sting from the database, which in fact
> looks like this:
>
> <LineString><coordinates>4.4701,52.1559 4.4696,52.1561 4.4693,52.1563
> 4.4689,52.1565</coordinates></LineString>
>
>
> I would like to use the LineString Class to generate polylines on the
> map. The documentation shows that the constructor is
> LineString(x:XMLList). The question is why the following throws an
> error?
>
> var roadNetworkAC:ArrayCollection = new ArrayCollection( result.result
> as Array );
> var lineString:LineString = new
> LineString(roadNetworkAC.getItemAt(0).kml as XMLList) <-- error: type
> coercion failed
>
> What casting/conversion should I use?
>
> Thanks in advance!
> >
>

--~--~---------~--~----~------------~-------~--~----~
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