@@ -253,9 +253,10 @@ var readFile = function(file) {
253253 file . type . indexOf ( 'kmz' ) === - 1 &&
254254 file . type . indexOf ( 'json' ) === - 1 &&
255255 file . type . indexOf ( 'image/jpeg' ) === - 1 &&
256+ file . type . indexOf ( 'image/webp' ) === - 1 &&
256257 file . type . indexOf ( 'image/png' ) === - 1 &&
257258 file . type . indexOf ( 'image/tiff' ) === - 1 ) {
258- console . log ( 'File is not text, kml, kmz, jpeg, png, or json' , file . type , file ) ;
259+ console . log ( 'File is not text, kml, kmz, jpeg, png, webp, or json' , file . type , file ) ;
259260 return ;
260261 }
261262
@@ -2359,17 +2360,19 @@ function setMarker(data) {
23592360 if ( data . hasOwnProperty ( "greatcircle" ) ) { delete data . greatcircle ; }
23602361
23612362 // then any remaining properties to the info box
2363+ var longline = 0 ;
23622364 if ( data . popup ) { words = data . popup ; }
23632365 else {
23642366 words += '<table>' ;
23652367 for ( var i in data ) {
23662368 if ( ( i != "name" ) && ( i != "length" ) && ( i != "clickable" ) ) {
23672369 if ( typeof data [ i ] === "object" ) {
2368- words += '<tr><td>' + i + '</td><td>' + JSON . stringify ( data [ i ] ) + '</td></tr>' ;
2370+ words += '<tr><td valign="top" >' + i + '</td><td>' + JSON . stringify ( data [ i ] ) + '</td></tr>' ;
23692371 }
23702372 else {
23712373 // words += i +" : "+data[i]+"<br/>";
2372- words += '<tr><td>' + i + '</td><td>' + data [ i ] + '</td></tr>' ;
2374+ if ( data [ i ] . length > longline ) { longline = data [ i ] . length ; }
2375+ words += '<tr><td valign="top">' + i + '</td><td>' + data [ i ] + '</td></tr>' ;
23732376 }
23742377 }
23752378 }
@@ -2379,6 +2382,7 @@ function setMarker(data) {
23792382 words = "<b>" + data [ "name" ] + "</b><br/>" + words . replace ( / \$ { name} / g, data [ "name" ] ) ; //"<button style=\"border-radius:4px; float:right; background-color:lightgrey;\" onclick='popped=false;popmark.closePopup();'>X</button><br/>" + words;
23802383 var wopt = { autoClose :false , closeButton :true , closeOnClick :false , minWidth :200 } ;
23812384 if ( words . indexOf ( '<video ' ) >= 0 || words . indexOf ( '<img ' ) >= 0 ) { wopt . maxWidth = "640" ; } // make popup wider if it has an image or video
2385+ if ( longline > 100 ) { wopt . minWidth = "640" ; } // make popup wider if it has a long line
23822386 if ( ! data . hasOwnProperty ( "clickable" ) && data . clickable != false ) {
23832387 marker . bindPopup ( words , wopt ) ;
23842388 marker . _popup . dname = data [ "name" ] ;
0 commit comments