html - White lines in OSM (OpenLayers) -
i have piece of code in jsp show map using osm (openstreetmap, collaborative project create free editable map of world) see white lines in map
<div class="windowcontentmap" > <div id="map" style="width: 97%; height: 94%"></div> <script src="http://www.openlayers.org/api/openlayers.js"></script> <script> var lat = '${lat}'; var lon = '${lng}'; var zoom = 9; var fromprojection = new openlayers.projection("epsg:4326"); // transform wgs 1984 var toprojection = new openlayers.projection("epsg:900913"); // spherical mercator projection var position = new openlayers.lonlat(lon, lat).transform( fromprojection, toprojection); map = new openlayers.map("map"); var mapnik = new openlayers.layer.osm(); map.addlayer(mapnik); var markers = new openlayers.layer.markers( "markers" ); map.addlayer(markers); markers.addmarker(new openlayers.marker(position)); map.setcenter(position, zoom); var mylocation = new openlayers.geometry.point(lon, lat).transform('epsg:4326', 'epsg:3857'); </script> </div> </div> .windowcontentmap div{ height: 334px; display: block; border-left: 1px solid #efefef; border-right: 1px solid #efefef; }
i suspect problem css, not js/openlayers.
try
#map { height: 334px; display: block; border-left: 1px solid #efefef; border-right: 1px solid #efefef; }
you giving border divs children of div.windowcontentmap , divs created openlayers getting border.
Comments
Post a Comment