wms overlay
overlay wms tiles. Embeded openlayers library syncs with provided dataset.
<html>
<body>
<div id="map" style="position:relative;left:100px;width:400px;height:400px;"><div>
</body>
<script type="text/javascript" src="http://www.spacial.io/cad4web/lib/cad4web.js"><script>
<script>
var cad = new cad4web.ContextClass( 'map', { backgroundColor: [0, 0, 0, 0.00001] });
var file = 'http://www.spacial.io/cad4web/files/paris_roads_gen.shp;
cad.clear();
cad.addShp(file, [255, 0, 0 ] )
.then (function () {
cad.extent();
cad.loadWms();
}) ;
</script>
</html>
<body>
<div id="map" style="position:relative;left:100px;width:400px;height:400px;"><div>
</body>
<script type="text/javascript" src="http://www.spacial.io/cad4web/lib/cad4web.js"><script>
<script>
var cad = new cad4web.ContextClass( 'map', { backgroundColor: [0, 0, 0, 0.00001] });
var file = 'http://www.spacial.io/cad4web/files/paris_roads_gen.shp;
cad.clear();
cad.addShp(file, [255, 0, 0 ] )
.then (function () {
cad.extent();
cad.loadWms();
}) ;
</script>
</html>
// map div must have explicitly position defined
(absolute, relative, etc).
// File on server must have header
Access-Control-Allow-Origin: *
// clear library intro image
// after file loading, call loadWms()
currently only 'EPSG:4328' is supported