Multiple KML files

104 views
Skip to first unread message

artesea

unread,
Jul 27, 2010, 4:05:55 PM7/27/10
to Google Maps JavaScript API v3
I'm working on a project to display multiple ward boundaries on a
google map for an electoral area.

In Lincoln (UK) where I live we have 11 wards, and this works fine:
http://dev.artesea.co.uk/maps/?parent=2385

however for Rugby who have 61 wards I can see the script loading the
KML files but in the end there is nothing layered on the screen, but
clicking around does bring up popups with the name.
http://dev.artesea.co.uk/maps/?parent=2459

Is there a limit on the amount of KML files (either in number or file
sizes) that I might be hitting?

Also the KMLs are third party, is there anyway for me to change the
colours of the fill in javascript as I don't have access to add extra
xml data in to the source file?

William

unread,
Jul 27, 2010, 8:28:18 PM7/27/10
to Google Maps JavaScript API v3
On Jul 28, 6:05 am, artesea <ryancul...@gmail.com> wrote:
>
> Is there a limit on the amount of KML files (either in number or file
> sizes) that I might be hitting?
>

the URL for each KML file is transformed into a unique ID, and these
IDs are used in the URL for each map tile.

There's a limit to the length of a URL, somewhere around 2000
characters. Google will have to use a lower limit based on the worst
browser.

Using Firebug it appears each ID is about 60 characters long, so 25
KMLs will result in a url about 1500 characters long. It seems that a
request for 25 KMLs is successful (return code of 200), but the next
request for 26 KMLs fails with return code 400 (bad request). So it
might be a limit of 1600 characters on the URL length to the tile
server:

25 KMLs, url length = 1573 characters
http://mt0.google.com/mapslt/hl=en-GB&lyrs=kml%3Acr3GAEmzL6rYEt6fFDlpqwOSSStNmJA%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSiaoeCQ%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwORSgPbgORI%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSS3CIlRwI%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSnGn6Gwk%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSXNORj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capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwORSQFMWjQQ%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSifaNBA%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSnOtIjQQ%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSHARUMBI%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSI8mNBA%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSiRoZCQ%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOQSPjxsJA%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSI7EYCQ%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwORSgAp0PRI%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSXHS6Hgk%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSiXofCQ%7Ckv%3A3%7Capi%3A3%2Ckml%3Acr3GAEmzL6rYEt6fFDlpqwOSSnC40MhI%7Ckv%3A3%7Capi%3A3&x=1016&y=672&z=11&w=256&h=256&source=maps_api


...

ClubPit

unread,
Jul 28, 2010, 3:29:00 AM7/28/10
to Google Maps JavaScript API v3
We're doing something similar down in Northampton.

http://selfserve.northampton.gov.uk/mycounciltest/

It maps out the wards, colours them according to the party controlling
them and shows images of your councillors as you move the mouse around
the map. You can also click on the map and do more things for that
particular ward. The logic and data behind this are seperate, so just
by supplying a data file for Rugby, or anywhere, you can get the same
functionality without having to care about how it's done. If you want
more details, get in touch, we plan on uploading this and our upcoming
mobile applications as open source for anyone to use.

KW

Lenius

unread,
Jul 28, 2010, 7:14:45 AM7/28/10
to Google Maps JavaScript API v3


On 27 Jul., 22:05, artesea <ryancul...@gmail.com> wrote:
> I'm working on a project to display multiple ward boundaries on a
> google map for an electoral area.
>
> In Lincoln (UK) where I live we have 11 wards, and this works fine:http://dev.artesea.co.uk/maps/?parent=2385
>
> however for Rugby who have 61 wards I can see the script loading the
> KML files but in the end there is nothing layered on the screen, but
> clicking around does bring up popups with the name.http://dev.artesea.co.uk/maps/?parent=2459
>
> Is there a limit on the amount of KML files (either in number or file
> sizes) that I might be hitting?

You can read more about kml sizes here.
http://code.google.com/intl/da-DK/apis/kml/documentation/mapsSupport.html

Size and Complexity Restrictions for KML Rendering in Google Maps
Google Maps currently has specific limitations to the size and
complexity of loaded KML files. Below is a summary of the current
limits:

Note: these limits are temporary and are subject to change at any
time.

Maximum fetched file size (raw KML, raw GeoRSS, or compressed KMZ)
3MB
Maximum uncompressed KML file size 10MB
Maximum number of Network Links 10
Maximum number of total document-wide features 1,000
Reply all
Reply to author
Forward
0 new messages