Lat and Lon not same as GE

14 views
Skip to first unread message

Purplepieman

unread,
Jun 18, 2008, 9:02:30 AM6/18/08
to KML Developer Support - Google Earth Browser Plugin
I am trying to create some placemarks for the GE plugin. I open GE
and get the lat and lon for the point (i.e. LAT 46.123401 and LON
63.053279) but when I open a new GE Plug in (see code below) and open
it in the browser, it puts me south of the point (and a little to the
right). It is not an address I am trying to use, but a spot in a
field. Can anyone tell me why this happens? (I actually found the
LAT and LON closer to 46.211001,-63.091279 of where I want).


<html>
<head>
<title>Google Earth!</title>
<script src="http://www.google.com/jsapi?key=AB123"></script>
<script>
google.load("earth", "1");

var ge = null;

function init() {
google.earth.createInstance("map3d", initCallback, failureCallback);
}

function initCallback(object) {
ge = object;
ge.getWindow().setVisibility(true);

var la = ge.createLookAt('');
la.set(46.123401,-63.053279, 1500, ge.ALTITUDE_RELATIVE_TO_GROUND, 0,
0, 0);

ge.getView().setAbstractView(la);



ge.getOptions().setStatusBarVisibility(true);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);
ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);


}

function failureCallback(object) {
}

</script>
</head>
<body onload='init()';

<div id='map3d_container'
style='border: 1px solid silver; height: 100%; width:
100%;'>
<div id='map3d' style='height: 100%;'></div>
</div>
</body>
</html>

DougH

unread,
Jun 18, 2008, 9:18:05 AM6/18/08
to KML Developer Support - Google Earth Browser Plugin
So, you're getting a location and view from Google Earth and it
doesn't look the same when you use the plugin? I don't know if its the
same thing, but I posted earlier that I was trying to do something
similar and had to close the sidebar in GE to get the view to match
what would appear in the plugin when using the same location and view.

ManoM

unread,
Jun 18, 2008, 3:01:36 PM6/18/08
to KML Developer Support - Google Earth Browser Plugin
Hi Purplepieman,

Do you have an actual page you can point to, and a KML file that you
have for comparison?

Mano

Purplepieman

unread,
Jun 18, 2008, 3:34:43 PM6/18/08
to KML Developer Support - Google Earth Browser Plugin
Here is the page that I am testing with.

http://www.graphcom.pe.ca/maps/golf.html

and here is the KML file that I am using to place the pointers on the
map. When I open GE and go to these places it shows the LAT and LON
as different as you will see.

Thanks

------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<name>Hole 1.kml</name>
<Style id="sn_1">
<IconStyle>
<scale>0.5</scale>
<Icon>
<href>http://www.graphcom.pe.ca/maps/images/icon1off.png</href>
</Icon>
<hotSpot x="32" y="1" xunits="pixels" yunits="pixels"/>
</IconStyle>
<ListStyle>
<ItemIcon>
<href>http://www.graphcom.pe.ca/maps/images/icon1off.png</href>
</ItemIcon>
</ListStyle>
</Style>
<Style id="sh_1">
<IconStyle>
<scale>0.7</scale>
<Icon>
<href>http://www.graphcom.pe.ca/maps/images/icon1on.png</href>
</Icon>
<hotSpot x="32" y="1" xunits="pixels" yunits="pixels"/>
</IconStyle>
<ListStyle>
<ItemIcon>
<href>http://www.graphcom.pe.ca/maps/images/icon1on.png</href>
</ItemIcon>
</ListStyle>
</Style>
<Style id="sn_1a">
<IconStyle>
<scale>0.5</scale>
<Icon>
<href>http://www.graphcom.pe.ca/maps/images/flag.png</href>
</Icon>
<hotSpot x="32" y="1" xunits="pixels" yunits="pixels"/>
</IconStyle>
<ListStyle>
<ItemIcon>
<href>http://www.graphcom.pe.ca/maps/images/flag.png</href>
</ItemIcon>
</ListStyle>
</Style>
<Style id="sh_1a">
<IconStyle>
<scale>0.7</scale>
<Icon>
<href>http://www.graphcom.pe.ca/maps/images/flag.png</href>
</Icon>
<hotSpot x="32" y="1" xunits="pixels" yunits="pixels"/>
</IconStyle>
<ListStyle>
<ItemIcon>
<href>http://www.graphcom.pe.ca/maps/images/flag.png</href>
</ItemIcon>
</ListStyle>
</Style>
<StyleMap id="msn_1">
<Pair>
<key>normal</key>
<styleUrl>#sn_1</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#sh_1</styleUrl>
</Pair>
</StyleMap>
<StyleMap id="msn_1a">
<Pair>
<key>normal</key>
<styleUrl>#sn_1a</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#sh_1a</styleUrl>
</Pair>
</StyleMap>
<StyleMap id="msn_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>#sn_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#sh_ylw-pushpin</styleUrl>
</Pair>
</StyleMap>
<Style id="sn_ylw-pushpin">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</
href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
</Style>
<Style id="sh_ylw-pushpin">
<IconStyle>
<scale>1.3</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</
href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
</Style>
<Placemark>
<name>470 yards</name>
<description>Hole 1</description>
<LookAt>
<longitude>-63.09233485595586</longitude>
<latitude>46.20950348446768</latitude>
<altitude>0</altitude>
<range>517.0052619926832</range>
<tilt>60.16036250174327</tilt>
<heading>-3.578820400744816</heading>
</LookAt>
<styleUrl>#msn_1</styleUrl>
<Point>
<coordinates>-63.09233485595586,46.20950348446768,0</coordinates>
</Point>
</Placemark>
<Placemark>
<description>Hole 1 Flag</description>
<LookAt>
<longitude>-63.09633485595586</longitude>
<latitude>46.20755048446768</latitude>
<altitude>0</altitude>
<range>517.0052619926832</range>
<tilt>60.16036250174327</tilt>
<heading>-3.578820400744816</heading>
</LookAt>
<styleUrl>#msn_1a</styleUrl>
<Point>
<coordinates>-63.09633485595586,46.20755048446768,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Hole1Path</name>
<styleUrl>#msn_ylw-pushpin</styleUrl>
<LineString>
<tessellate>1</tessellate>

<coordinates>-63.09233485595586,46.20950348446768,0,-63.09433485595586,46.20800348446768,0,-63.09633485595586,46.20755048446768,0</
coordinates>
</LineString>
</Placemark>
</Document>
</kml>

Neil...@googlemail.com

unread,
Jun 18, 2008, 8:26:55 PM6/18/08
to KML Developer Support - Google Earth Browser Plugin
Purplepieman,

I had a similar issue when first trying to get this all working - the
location I used as my lon & lat would put my location below and to the
right of where it should be. I now use this website:
http://www.gorissen.info/Pierre/maps/googleMapLocation.php to pinpoint
my location and then put the results into my code. Using it, I just
had a look at where your page first points to and I came up with:
http://www.gorissen.info/Pierre/maps/googleMapLocation.php?lat=46.207599&lon=-63.096430&setLatLon=Set

Lon: 46.207599
Lat: -63.096430

Which pretty much matches up with what you say in your first post -
" (I actually found the LAT and LON closer to 46.211001,-63.091279 of
where I want). "

Hope that site helps!
> <coordinates>-63.09233485595586,46.20950348446768,0,-63.09433485595586,46.2­0800348446768,0,-63.09633485595586,46.20755048446768,0</
> > > </html>- Hide quoted text -
>
> - Show quoted text -

Neil...@googlemail.com

unread,
Jun 18, 2008, 11:37:02 PM6/18/08
to KML Developer Support - Google Earth Browser Plugin
Having read up a bit more, it looks like GE uses Degrees, Minutes &
Seconds but in your code, you need to convert to decimal degrees.
I've knocked up a simple vbscript that will do this for you if you
want it, or there are places on the net that convert it...Let me know
if you'd like the script.

On Jun 19, 1:26 am, "[email address]" wrote:
> Purplepieman,
>
> I had a similar issue when first trying to get this all working - the
> location I used as my lon & lat would put my location below and to the
> right of where it should be.  I now use this website:http://www.gorissen.info/Pierre/maps/googleMapLocation.phpto pinpoint
> my location and then put the results into my code.  Using it, I just
> had a look at where your page first points to and I came up with:http://www.gorissen.info/Pierre/maps/googleMapLocation.php?lat=46.207...
> ...
>
> read more »- Hide quoted text -

TomHarvey

unread,
Jun 19, 2008, 5:41:05 AM6/19/08
to KML Developer Support - Google Earth Browser Plugin
I did the same thing in Excel Using this formula:

Decimal = Degrees+(((Seconds/60)+minutes)/60)

I used six input cells for Degrees, Minutes and Second of both
Latitude and Longitude and two output cells for the decimal
eqivalents.

Tom
Reply all
Reply to author
Forward
0 new messages