it's working, so thanks a lot for encouraging and advicing this. kml
got it ditching the name to description element getting special
characters accordingly. it seems description handles CDATA way name
can't. best regards.
self.response.out.write('<?xml version="1.0" encoding="UTF-8"?><kml
xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/
kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2"
xmlns:atom="http://www.w3.org/2005/Atom"><Document>')
for ad in ads:
if ad.geopt:
if ad.matched_images.get():
imageid=ad.matched_images.get().key().id()
kml = ('<Placemark><name></name><description><!
[CDATA[<img src="http://%s/images/%d.%s"> %s ]]></
description><Style><IconStyle><Icon><href>http://www.google.com/intl/
en_us/mapfiles/ms/icons/green-dot.png</href></Icon></IconStyle></
Style> <Point><coordinates>%d,%d</coordinates></Point></Placemark>'
) %(url,ad.matched_images.get().key().id
(),ad.matched_images.get().full_ext,'<a href="http://'+url+'/'+str
(ad.key().id())+'">'+ad.title+'</a><br/> '+defaultfilters.urlize
( defaultfilters.truncatewords( ad.text ,
20 ) ),ad.geopt.lon,ad.geopt.lat)
else:
kml = ('<Placemark><name></name><description><!
[CDATA[ %s ]]></description><Style><IconStyle><Icon><href>http://
www.google.com/intl/en_us/mapfiles/ms/icons/green-dot.png</href></Icon></IconStyle></Style>
<Point><coordinates>%d,%d</coordinates></Point></Placemark>'
) %('<a href="http://'+url+'/'+str(ad.key().id())
+'">'+ad.title+'</a><br/>'+defaultfilters.urlize
( defaultfilters.truncatewords( ad.text ,
20 ) ),ad.geopt.lon,ad.geopt.lat)
self.response.out.write(kml)
self.response.out.write( '</Document></kml>')
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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
-~----------~----~----~----~------~----~------~--~---