javascript - leaflet blank screen on meteor but not on single nonmeteor test.html -
i´m using leaflet on meteor showing blank (grey) map without displaying map tiles. when test script locally in single html file working.
<html> <head> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> </head> <body> test <div id="map" style="height: 180px;"></div> 123 <script> var map = l.map('map').setview([51.505, -0.09], 13); l.tilelayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', { maxzoom: 18 }).addto(map); var marker = l.marker([51.5, -0.09]).addto(map); marker.bindpopup("some text :)"); </script> </body> </html>
but not working when try in meteor. meteor setup:
i have main.html declare cdns:
<head> <script src="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <meta name="viewport" content="width=device-width, initial-scale = 1.0, user-scalable = no"> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-1.0.0-b1/leaflet.css"/> </head>
i use iron:router route. there map.html map template have my
<div id="map"></div>
i have setup #map{height: 180px;} in stylesheet.
so have run script javascript template.map.rendered function
template.map.rendered = function () { var map = l.map('map').setview([51.505, -0.09], 13); l.icon.default.imagepath = "/images/leaflet/"; l.tilelayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', { maxzoom: 18 }).addto(map); var marker = l.marker([51.5, -0.09]).addto(map); marker.bindpopup("some text :)"); };
but not work. causing blank map error? browser console not showing error.
ok figured out problem. have reset.css have reset rules ui.
this line producing error:
div, a, p, img, blockquote, form, fieldset, textarea, input, label, iframe, code, pre { stuff, stuff, overflow:hidden; <--------- }
so looks leaflet
don´t divs overflow:hidden
option
Comments
Post a Comment