javascript - ol3Cesium map not loading, giving error ''olcs is not defined" -
i unable load ol3cesium map in ionic 2.
my index.html (code within body tag):
<ion-app></ion-app> <script src="http://openlayers.org/en/v3.16.0/build/ol.js" <script src="../ol3-cesium-v1.17/ol3cesium.js"></script> <script src="../ol3-cesium-v1.17/cesium/cesium.js"></script>
my home.ts:
inside constructor, below code added --
var view = new ol.view({ projection: 'epsg:4326', center: [-100, 35], zoom: 3 }); var layer = new ol.layer.tile({ source: new ol.source.tilewms({ url: 'http://demo.boundlessgeo.com/geoserver/wms', params: { 'layers': 'ne:ne1_hr_lc_sr_w_dr' } }) }); var overlay = new ol.layer.tile({ opacity: 0.7, extent: [-124.74, 24.96, -66.96, 49.38], source: new ol.source.tilewms(/** @type {olx.source.tilewmsoptions} */({ url: 'http://demo.boundlessgeo.com/geoserver/wms', params: { 'layers': 'topp:states', 'tiled': true }, servertype: 'geoserver', crossorigin: 'anonymous' })) }); var ol2d = new ol.map({ layers: [layer, overlay], target: 'map2d', view: view }); var ol3d = new olcs.olcesium({ map: ol2d }); var scene = ol3d.getcesiumscene(); var terrainprovider = new cesium.cesiumterrainprovider({ url: '//assets.agi.com/stk-terrain/world' }); ol3d.getcesiumscene().scene.terrainprovider = terrainprovider; ol3d.setenabled(true); });
'map2d' div id in home.html
.
i don't know why saying 'olcs not defined' when running project ionic serve --lab
. how can resolve javascript issue?
i solved it. had put cesium.js , ol3cesium inside www folder.
Comments
Post a Comment