Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balloon does not expand to fit image, placemark shown. #39

Open
DStillingfleet opened this issue Jul 21, 2022 · 0 comments
Open

Balloon does not expand to fit image, placemark shown. #39

DStillingfleet opened this issue Jul 21, 2022 · 0 comments

Comments

@DStillingfleet
Copy link

Hi

Nice plug in.

I have a kml file that uses html for the contents of the balloon when a place icon is clicked on. Here is an example.

<Placemark>
	<name>Mulhacén II (3362m)</name>
	 <description>        
		<![CDATA[
			<DIV style='max-width:400px; margin-right:10px; margin-bottom:10px; color:#674A32; font-family:Arial'>
				<DIV style='font-size:11pt; font-weight:bold; text-align:left'>
					Mulhacén II (3362m)<BR>
				</DIV>
				<DIV style='font-size:10pt; text-align:justify'>
					<BR>
					<IMG SRC='Info_MulhacenII.jpg'  width='96px' height='120px' align='left' title='Summit of Mulhacén II' style='margin-right:10px'>
					
					&apos;Los Tres Miles&apos; rank: 4<BR><BR>
					Mulhacén II lies in Mulhacén's south ridge. It&apos;s summit is marked geodetic column.
				</DIV>
			</DIV>
		]]>
	</description>
	<styleUrl>#Summit_Target</styleUrl>  
	<Point><coordinates>-3.3120817235360001,37.0442429896920018,0</coordinates></Point>
</Placemark>

When used with Google maps or Google Earth the balloon expands to fit the text and graphic.

Unfortunately the with this plug in, unless the text is long enough to wrap around the image, the image will extend beyond the balloon. Like this...

image

This is what it looks like in Google Earth....

image

You'll also notice that Google Earth is not showing the placemark name. It has been deliberately disabled so that I could have more control over it. Here's the KML that defines styling on the placemark and balloon.

<Style id='Summit_Target'>
    <IconStyle>
		<Icon>
			<href>https://www.virtualmountains.co.uk/shared/Summit_Target.png</href>
		</Icon>
	</IconStyle>
	<BalloonStyle>
		<text>$[description]</text>
		<bgColor>white</bgColor>
		<text><![CDATA[
			<font color='#674A32' face='arial' align='justify'>$[description]</font>
		]]></text>
  	</BalloonStyle>
	<LabelStyle>
  		<color>FF14B450</color>
  		<scale>0.8</scale>
	</LabelStyle>
</Style>

Any useful suggestions as to how I can reproduce this with the leaflet plugin. I'm wanting to use the same KML file for both Google Maps and Leaflet.

Many thanks

Derek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant