kml with heatmap

317 views
Skip to first unread message

OBPG Admin

unread,
Mar 25, 2011, 2:00:50 PM3/25/11
to google-map...@googlegroups.com
Working with density heat maps using http://jjguy.com/heatmap/

This is my output KML file:

<?xml version="1.0" encoding="UTF-8"?>
  <Folder>
    <GroundOverlay>
      <Icon>
        <href>classic.png</href>
      </Icon>
      <LatLonBox>
        <north>90.0000000000000000</north>
        <south>-90.0000000000000000</south>
        <east>180.0000000000000000</east>
        <west>-180.0000000000000000</west>
        <rotation>0</rotation>
      </LatLonBox>
    </GroundOverlay>
  </Folder>
</kml>

Adding KML overlay:
   // KML layer                                                                                                                                                                                                          
   var kmlLayer = new google.maps.KmlLayer('data.kml', { preserveViewport : true });                                                                                                                            
   kmlLayer.setMap(Map.map);    

Nothing shows up.

Any ideas? Is there something I can do to see if the layer is being loaded? Is the LatLon box an issue?

Rossko

unread,
Mar 25, 2011, 3:35:20 PM3/25/11
to Google Maps JavaScript API v3
> Any ideas?

Only wild guesses, there is a reason the posting guidelines at "READ
THIS FIRST"
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/2b3f101fd509919e
ask for a link to your problem.

Maybe your KML isn't publicly available on the web. Maybe your image
isn't publicly available on the web. Maybe your urls needs path
clarifying.

> Is there something I can do to see if the layer is being loaded?

It is possible to paste the url of your KML into the search box of
maps.google.com and see what that thinks.

> Is the LatLon box an issue?

It might well be. It's open to interpetation, is that the whole world
or is it zero sized, as the east/west bounds are exactly the same
place?

OBPG Admin

unread,
Mar 25, 2011, 4:52:18 PM3/25/11
to google-map...@googlegroups.com, Rossko
Pasting my KML file into maps.google.com also does not work. However, opening up the KML file using google earth works just fine. Both my KML and image file are publicly available on the web. 

Nathan Raley

unread,
Mar 25, 2011, 4:54:23 PM3/25/11
to google-map...@googlegroups.com
Do you have a link to the site where you are trying to load the KML file using the API?  Would help quite a lot with trying to help you narrow this down.

On Fri, Mar 25, 2011 at 3:52 PM, OBPG Admin <obpg...@gmail.com> wrote:
Pasting my KML file into maps.google.com also does not work. However, opening up the KML file using google earth works just fine. Both my KML and image file are publicly available on the web. 

--
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 google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Barry Hunter

unread,
Mar 25, 2011, 4:54:48 PM3/25/11
to google-map...@googlegroups.com
As you dont want to share it here, perhaps you could try running
though a validator, such as http://feedvalidator.org/

Nathan Raley

unread,
Mar 25, 2011, 4:59:18 PM3/25/11
to google-map...@googlegroups.com
Yea, that would have been my next suggestion to him if he doesn't want to show us a link.  If it passes the validator okay, then a link would probably be necessary for us to help you further.
 
However, if it doesn't pass the validator, it will point you in the right direction as to what is causing the issues in the Maps API.

Pier Francesco sciuto

unread,
Mar 26, 2011, 12:33:22 PM3/26/11
to google-map...@googlegroups.com

Hi
I have done some experiments for kml and kmz manage with google map v3
 
at
 
 
I hope these can be useful
 
regards
 
pif

OBPG Admin

unread,
Mar 28, 2011, 10:59:59 AM3/28/11
to google-map...@googlegroups.com, Pier Francesco sciuto
Thanks for all the help guys.

1. feedvalidator.org validates my KML file.

2. Here are the two relevant files in public locations:

See if you have any more luck than I do and post back! Thanks again.

geoco...@gmail.com

unread,
Mar 28, 2011, 11:54:13 AM3/28/11
to Google Maps JavaScript API v3
On Mar 28, 7:59 am, OBPG Admin <obpg.g...@gmail.com> wrote:
> Thanks for all the help guys.
>
> 1. feedvalidator.org validates my KML file.
>
> 2. Here are the two relevant files in public locations:http://dl.dropbox.com/u/114969/data.kmlhttp://dl.dropbox.com/u/114969/classic.jpg
>
> See if you have any more luck than I do and post back! Thanks again.

Have you tried using the complete url to the image?


-- Larry

OBPG Admin

unread,
Mar 28, 2011, 3:19:51 PM3/28/11
to google-map...@googlegroups.com, geoco...@gmail.com
Larry -

I have tried using a direct url to the image. Still the same problem.

The image currently sits in the same directory as the kml file.

geoco...@gmail.com

unread,
Mar 28, 2011, 3:32:54 PM3/28/11
to Google Maps JavaScript API v3
On Mar 28, 12:19 pm, OBPG Admin <obpg.g...@gmail.com> wrote:
> Larry -
>
> I have tried using a direct url to the image. Still the same problem.

But did you try Rossko's suggestion of making the LatLon box bigger
than 0?
(the first answer you got in this thread? Makes one think you didn't
read it)
http://groups.google.com/group/google-maps-js-api-v3/msg/e12c0beadb394c78

When I change it to
<north>85.0000000000000000</north>
<south>-85.0000000000000000</south>
<east>179.0000000000000000</east>
<west>-179.0000000000000000</west>

It works for me:
http://maps.google.com/maps?q=http:%2F%2Fwww.geocodezip.com%2Fgeoxml3_test%2FOBPG_Admin_dataA_kml.xml&oe=utf-8&client=firefox-a&ie=UTF8&hl=en&z=2

>
> The image currently sits in the same directory as the kml file.

Irrelevant. Depends on how the google server decodes the url (which I
don't have any insight into). I have seen posts that imply it doesn't
use the URL of the kml file as a base directory (I think there is an
issue filed about it).

-- Larry

OBPG Admin

unread,
Mar 30, 2011, 10:54:11 AM3/30/11
to google-map...@googlegroups.com
To clarify, according to the KML documentation:
<LatLonBox>
Specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned
In this case, you changed the LatLonBox to the maximum amount of bounding possible to allow this to work. 
Using google maps, the KML overlay lines up perfectly to where it should be. 
Would there be any reason or any situation where using this KML overlay within my google maps api application would result in a misalignment of the overlay image (eg. overlay is skewed to the right or left)?
Thanks.

Rossko

unread,
Mar 30, 2011, 12:25:30 PM3/30/11
to Google Maps JavaScript API v3
> Would there be any reason or any situation
> where using this KML overlay within my google maps api application would
> result in a misalignment of the overlay image (eg. overlay is skewed to the
> right or left)?Thanks.

I don't really understand the question, maybe a demo would help if
this is something you've observed.
If the question is "can things get screwy when more than one world is
in view" I guess the answer is yes, because lat/long coordinate system
breaks down.
Reply all
Reply to author
Forward
0 new messages