Kazu46Machi / earth-api-samples

Automatically exported from code.google.com/p/earth-api-samples
0 stars 0 forks source link

Google Earth repositions and zooms out the first time a marker is clicked #144

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a Google Earth Map and add a marker
2. Zoom in on the marker and then click it
3. the map will zoom out after the first ckick only

This is bad because the user will always have to zoom back in again.
Check out www.rentication.com and click on gmap button to see this 
behavior.

What is the expected output or behavior? What do you see instead?
expect that the map does not soom out on the first click of a marker

Which plugin version are you using?
latest one

Which browsers and operating systems are affected?
FF and IE

Please provide any additional information (code snippets/links) below.

Original issue reported on code.google.com by waelmans...@gmail.com on 23 Jan 2009 at 6:06

GoogleCodeExporter commented 8 years ago
for a sample of this behavior try www.rentication.com

Original comment by waelmans...@gmail.com on 23 Jan 2009 at 7:43

GoogleCodeExporter commented 8 years ago
yes we have this too, I had thought it was a problem with our code.  Makes the 
click 
pin option unusable more than once.

Original comment by david.jo...@googlemail.com on 7 Apr 2009 at 11:27

GoogleCodeExporter commented 8 years ago
Can someone provide a more exact reproduction case? A test web site with clear 
test
steps would really help.

Original comment by api.roman.public@gmail.com on 25 Jun 2009 at 6:31

GoogleCodeExporter commented 8 years ago
This behavior can only be duplicated through using a third party ASP google map 
control.

Original comment by waelmans...@gmail.com on 26 Jun 2009 at 1:32

GoogleCodeExporter commented 8 years ago
Ah, if we can't reproduce this using native Maps API/Earth API code, we'll have 
to
close this out.

david.johmar, was your repro case using a third party library as well?

Original comment by api.roman.public@gmail.com on 26 Jun 2009 at 7:07

GoogleCodeExporter commented 8 years ago
Hi, I too have this problem...

The first time I click a marker to open a html info window, the viewport goes 
to the
one I set with "setCenter" at map creation time.

I can't put all the code but here's the main steps

var map = new GMap2(document.getElementById("mapcanvas"));
map.setCenter(new GLatLng(41.189846, -89.431125), 4);
map.addMapType(G_SATELLITE_3D_MAP);
map.setMapType(G_SATELLITE_3D_MAP);

[...]
Function to add markers markers:

function addMarker(map, lat, lng)
{
  var point = new GLatLng(lat, lng);
  var marker = new GMarker(point);
  map.addOverlay(marker);
  GEvent.addListener(marker, 'click', function() {
    var myHtml = 'Hello world';
    map.openInfoWindowHtml(point, myHtml);
  });
}

When I click on it in earth, the viewport goes to (41.189846, -89.431125) (But
keeping the current Pan)

The problem goes away but I noticed more glitches: sometimes I have to have a 
Pan of
0 for the html info window to open properly without messing with the viewport.

I have earth installed (5.0.11733.9347) but can't find the plugin version. 
Installed
it about a month or so.

Thanks and great work

Original comment by mikegleasonjr on 28 Jun 2009 at 2:38

GoogleCodeExporter commented 8 years ago
I found potential fix to the problem (in my case). I have a function to "fly 
to" an
address. 

When the map was not in earth mode, I would use setCenter to navigate to the
address.. When the map was in 3D mode, I would use a new lookAt (for its nice
animation) to navigate to the address.

Always using setCenter in both cases seems to fix the random zoom out when 
clicking
on markers.

One problem remains, it's when the user never use the "go to address" function 
and
navigate by himself to a marker. Now the zoom out bug still occurs.

Hope it can help?

Original comment by mikegleasonjr on 28 Jun 2009 at 4:44

GoogleCodeExporter commented 8 years ago
I test case reproducing the behavior described

Original comment by mikegleasonjr on 29 Jun 2009 at 12:06

Attachments:

GoogleCodeExporter commented 8 years ago
Downloading the latest API instead of the current stable solved the problem 
(v=2.x)

Original comment by mikegleasonjr on 1 Jul 2009 at 2:33

GoogleCodeExporter commented 8 years ago
Closing this out. Feel free to ping to reopen.

Original comment by api.roman.public@gmail.com on 1 Jul 2009 at 4:06