PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Bug in certain KML files (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Bug in certain KML files


#2420
peterkay (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Bug in certain KML files 1 Year, 1 Month ago Karma: 0  
It seems that certain KML files are not read by the application.

This does NOT load the KML file:
MapDirections


but this file one does:

MapDirections


Both KMLs were created by google earth and I tested them by loading into google maps.

Any ideas?
 
  The administrator has disabled public write access.

#2423
peterkay (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Re:Bug in certain KML files 1 Year, 1 Month ago Karma: 0  
I found your bug. There's a problem with parsing.

The following gets properly parsed as a proper init_gdir:

<googleDir lat=21.279491 long=-157.744741 zoom=14 control=GSmallZoomControl3D|GMapTypeControl kml=http://www.oahu-for-free.com/maps/poiEastHNL.kml maptype=G_HYBRID_MAP from="21.271685,-157.822852" to="21.26013471,-157.8183115 to:21.26945086,-157.778877 to:21.31299356,-157.6614052 to: 21.31299356,-157.6614052" >


this does not get properly parsed:

<googleDir lat=21.279491 long=-157.744741 zoom=14 control=GSmallZoomControl3D|GMapTypeControl maptype=G_HYBRID_MAP from="21.271685,-157.822852" to="21.26013471,-157.8183115 to:21.26945086,-157.778877 to:21.31299356,-157.6614052 to: 21.31299356,-157.6614052" kml=http://www.oahu-for-free.com/maps/poiEastHNL2.kml >

Specifically, there's an extra space of the kml URL in the init gdir which makes it fail:

init_gdir('1', 21.279491, -157.744741, 14, 'http://www.oahu-for-free.com/maps/poiEastHNL2.kml ', '21.271685,-157.822852', '21.26013471,-157.8183115 to:21.26945086,-157.778877 to:21.31299356,-157.6614052 to: 21.31299356,-157.6614052', '', 'GSmallZoomControl3D|GMapTypeControl', 'G_HYBRID_MAP', '1', '', '', '');

I'm glad I have a workaround and hope you feel good about the fact that one of your users help you debug! Great component and I'm really happy I was able to help you.
 
  The administrator has disabled public write access.

#2451
kksou (Admin)
Admin
Posts: 1240
graph
User Online Now Click here to see the profile of this user
Re:Bug in certain KML files 1 Year, 1 Month ago Karma: 20  
If you take a look at the codes, the KML files are not processed by my applications. It's processed by the standard google Maps API.

Yes, I found out too that not all KML files are processed by the API. Even some of the KML files generated by http://maps.google.com/ itself are not processed by the API.

This is the same case as for the google Maps Direction. The one in http://maps.google.com/ are less strict and more intelligent on the road names that you enter. But the API is much stricter.

Regards,
/kksou
 
  The administrator has disabled public write access.
#2452
peterkay (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Re:Bug in certain KML files 1 Year, 1 Month ago Karma: 0  
Yes, you are correct and I see that. But what I'm telling you is that your parsing of the actual string is incorrect. I discovered that yes, not all KML files are processed equally.

but the bug is with your string parsing. look @ my message above #2423
 
  The administrator has disabled public write access.
#2460
kksou (Admin)
Admin
Posts: 1240
graph
User Online Now Click here to see the profile of this user
Re:Bug in certain KML files 1 Year, 1 Month ago Karma: 20  
Hi Peterkay,

Please take a look at the following page:

http://www.kksou.com/php-gtk2/Joomla-Google-Maps-Directions-Samples/Google-Maps-directions-with-KML-files.php

I've reproduced your two codes there. The only changes I've made is the url of the kml file (because I think you have removed your original kml file).

As you can see, both the codes worked.

I think you might have used an older version of googleMaps or googleDirections. The latest versions are:
- googleMaps_v1.5.10
- googleDirections_v1.57

Regards,
/kksou
 
  The administrator has disabled public write access.
#2468
peterkay (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Re:Bug in certain KML files 1 Year, 1 Month ago Karma: 0  
I have the latest versions but now I can't seem to reproduce the problem. If/when I can, I'll post it here.
 
  The administrator has disabled public write access.



Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2009. kksou.com. All Rights Reserved