leaflet-map icon indicating copy to clipboard operation
leaflet-map copied to clipboard

vulcanize --inline-css breaks tiles

Open balloob opened this issue 10 years ago • 3 comments

Vulcanize is the Polymer build tool that can inline HTML and CSS imports. When an app is vulcanized with the --inline-css flag enabled, the map tiles will not show up correctly. This is caused due to the leaflet css file not loading correctly.

I am using Polymer 1.1.0 where external CSS files have been deprecated but should still work.

Can be reproduced by installing vulcanize and vulcanizing the demo.

npm install vulcanize
vulcanize --inline-css demo.html > demo.vulcan.html

Work around is to add this line to your root HTML file before vulcanizing, making the CSS available to all.

<link rel="import" type="css" href="../leaflet/dist/leaflet.css" />

balloob avatar Sep 21 '15 07:09 balloob

Having the same issue. Would be extremely nice to have fixed :-) :+1:

FranzThomsen1089 avatar Oct 07 '15 17:10 FranzThomsen1089

Adding a regular rel="stylesheet" line to the main.css build block worked for me.

In index.html:

<!-- build:css styles/main.css -->
<link rel="stylesheet" href="bower_components/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild-->

This will inline leaflet.css into main.css in the dist output.

13k avatar Dec 22 '15 04:12 13k

This would be very nice to have fixed :-)

FranzThomsen1089 avatar Mar 03 '16 11:03 FranzThomsen1089