On Sep 29, 5:27 pm, Will Cadell <[email protected]> wrote: > hey dude, > looking in firebug the KML overlay service gives this response: > > <html><head> > <meta http-equiv="content-type" content="text/html;charset=utf-8"> > <title>400 Bad Request</title> > <style><!-- > body {font-family: arial,sans-serif} > div.nav {margin-top: 1ex} > div.nav A {font-size: 10pt; font-family: arial,sans-serif} > span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: > bold} > div.nav A,span.big {font-size: 12pt; color: #0000cc} > div.nav A {font-size: 10pt; color: black} > A.l:link {color: #6f6f6f} > A.u:link {color: green} > //--></style> > <script><!-- > var rc=400; > //--> > </script> > </head> > <body text=#000000 bgcolor=#ffffff> > <table border=0 cellpadding=2 cellspacing=0 width=100%><tr><td > rowspan=3 width=1% nowrap> > <b><font face=times color=#0039b6 size=10>G</font><font face=times > color=#c41200 size=10>o</font><font face=times color=#f3c518 > size=10>o</font><font face=times color=#0039b6 size=10>g</font><font > face=times color=#30a72f size=10>l</font><font face=times > color=#c41200 size=10>e</font> </b> > <td> </td></tr> > <tr><td bgcolor="#3366cc"><font face=arial,sans-serif > color="#ffffff"><b>Error</b></td></tr> > <tr><td> </td></tr></table> > <blockquote> > <H1>Bad Request</H1> > Your client has issued a malformed or illegal request. > > <p> > </blockquote> > <table width=100% cellpadding=0 cellspacing=0><tr><td > bgcolor="#3366cc"><img alt="" width=1 height=4></td></tr></table> > </body></html> > > bad request, I guess you should revisit your kml... > > also looking briefly at your kml from firebug it seems you have a > bunch of points of which only 5 are showing up... I expect that that > might give you a good place to start looking in your kml (point 6) :) > > good luck! > > w Dear Sirs Thank you for the replies, This messy code is what makes the KML I should improve. class KML(webapp.RequestHandler):#get max, make static or cron job save file like blob def get(self): from django.template import defaultfilters start=datetime.datetime.now()-timedelta(days=150)#vary host = os.environ.get("HTTP_HOST", os.environ["SERVER_NAME"]) #count = 22 count = int(self.request.get('count')) if not self.request.get('count')=='' else 100 a= Aall().filter("modified >", start).filter("published =", True).order("-modified").fetch(count) 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 a: if Ageopt: image = Amatched_images.get() if image: imageid=image.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>' ) %(host,image.key().id(),image.full_ext,'<a href="http://'+host+'/'+str(Akey().id())+'">'+Atitle+'</a><br/ >'+defaultfilters.urlize( defaultfilters.truncatewords( Atext , 20 ) ),Ageopt.lon,Ageopt.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://'+host+'/'+str(Akey().id())+'">'+Atitle +'</a><br/ >'+defaultfilters.urlize( defaultfilters.truncatewords( >defaultfilters.striptags( Atext ) , 20 ) ),Ageopt.lon,Ageopt.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 JavaScript API v3" 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-js-api-v3?hl=en.
