iidioter / earth-api-samples

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

Auto-width for balloons in GE API fixed ratio of map window size - ignores div width #473

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Summary of issue (including error messages):

Balloon widths not consistent between Google Earth/Google Maps and Google Earth 
API in browser. DIV widths are ignored in GE API and balloons auto-sized to 
size of map.

What steps will reproduce the problem?

If the map width is much larger (e.g. 640 pixels) then it more clearly shows 
the problem.

Visit http://code.google.com/apis/ajax/playground/?exp=earth#creating_placemarks

Replace createPlacemark() body with following code:

function createPlacemark() {
      var placemark = ge.createPlacemark('');
       ge.getFeatures().appendChild(placemark);

      // Create  style map for placemark
      var icon = ge.createIcon('');
       icon.setHref('http://maps.google.com/mapfiles/kml/paddle/red-circle.png');
       var style = ge.createStyle('');
      style.getIconStyle().setIcon(icon);
       placemark.setStyleSelector(style);
      var desc = '<div style="width: 50px"> <a href="http://www.mkeriverkeeper.org/content/milwaukee-urban-water-trail"  title="MUWT logo"><img src="http://farm4.static.flickr.com/3405/3669800102_2ac8707ba0.jpg"   width="150" alt="MUWT logo" /></a><BR>\
     <p><b>Schlitz Brewery Ice Dam Rapids</b> - 6.2 miles  downstream from Mequon Villa Grove Park<br><br>\
     HAZARD. PASS BY ON RIVER RIGHT! This rundown dam just above Locust St  was built by the Schlitz Brewery in the early 1900&apos;s to hold  back water in winter months for ice harvesting. During this time, ice  wars were reported near both Locust St and North Ave bridges. The  &quot;Beer Line&quot; rail route used to run on the west bank of  the river from Locust St. to North Ave. - servicing Schlitz, Pabst and  Blatz breweries in the neighborhood. It is now a hiking and biking trail  managed by the River Revitalization Foundation. A small rapid is  present just under the Locust St. bridge; during low flows, anticipate a  one to two foot drop.\
    <br><br><a href="http://www.flickr.com/photos/milwaukeeriverkeeper/3769426551/"   title="Schlitz Ice dam by milwaukeeriverkeeper, on Flickr"><img  src="http://farm3.static.flickr.com/2482/3769426551_b0220d3464.jpg"   width="500" height="332" alt="Schlitz Ice dam" /></a></div>';
       placemark.setDescription(desc);

  // Create point
  var la = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
  var point = ge.createPoint('');
  point.setLatitude(la.getLatitude());
  point.setLongitude(la.getLongitude());
  placemark.setGeometry(point);

  counter++;
}

What is the expected output or behavior? What do you see instead?

Width of balloon is auto-resized to fixed portion of the map width and ignores 
width specified on DIV tag. 
Expect same/similar behavior as in Google Earth and Google Maps for same KML.

Which plugin version are you using?

 Google Earth Plugin 1.0.0.1

Which browsers and operating systems are affected?

FireFox 3.6.3, Windows XP

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

Links to other posts about this issue (please don't repost bugs):

http://www.google.com/support/forum/p/earth/thread?tid=40f0b671c475b0e0&hl=en

http://groups.google.com/group/google-earth-browser-plugin/browse_thread/thread/
7ba4c62dfbc5ed61/41f16a8b1f2e97f6?hl=en#41f16a8b1f2e97f6

Original issue reported on code.google.com by gjmath...@gmail.com on 13 Jun 2010 at 11:58

GoogleCodeExporter commented 9 years ago
The width of images via img tags override the div width (if larger) so 
corrected example showing this bug needs width=xxx value less equal to div 
width.

<img width="50" ...

Original comment by gjmath...@gmail.com on 19 Jun 2010 at 3:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Still same behavior with installed plugin 6.0.0.1735.

If you replace the div start/end tags with <table width=30"><TR><TD>...</table> 
then the fixed width works correctly. DIV width still ignored.

Original comment by gjmath...@gmail.com on 1 Dec 2010 at 2:54

GoogleCodeExporter commented 9 years ago
The GE Plugin also appears to ignore the height of images. Works fine in Google 
Earth.

Chrome 18.0.1025.162 m, Windows 7.

Original comment by piemaste...@gmail.com on 5 May 2012 at 9:43