openlayers 3 - Feature grid not taking data from geoserver layer WMS using geoext 3 -
this grid.js file included in grid.html. don't know wrong code. have seen examples , tried perform same geoserver layer no output. code after variable store not working. want load file on web , display data in feature grid using geoext 3.0.0. kindly help.
ext.require([ 'ext.container.container', 'ext.panel.panel', 'ext.grid.gridpanel', 'geoext.component.map', 'geoext.data.store.features' ]); ext.onready(function () { var wmslayer = new ol.layer.image({ source: new ol.source.imagewms({ url: 'http://localhost:8080/geoserver/opengeo/wms', params: {'layers': 'opengeo:abc'}, servertype: 'geoserver' }) }); var baselayer = new ol.layer.tile({ source: new ol.source.tilewms({ url: 'http://ows.terrestris.de/osm-gray/service', params: {'layers': 'osm-wms', 'tiled': true} }) }); var view = new ol.view({ center: ol.proj.fromlonlat([75, 36]), zoom: 8 }); var map = new ol.map({ layers: [ baselayer, wmslayer ], target: 'map', view: view }); var store = ext.create("geoext.data.store", { url: 'http://localhost:8080/geoserver/wms', params: {'layers': 'opengeo:abc'}, autoload: true }); grid1 = ext.create('ext.grid.panel', { title: 'main cities', border: true, region: 'east', store: store, columns: [ {text: 'cityname', dataindex: 'name'} ], width: 300 }); var mapcomponent = ext.create('geoext.component.map', { map: olmap }); var mappanel = ext.create('ext.panel.panel', { region: 'center', height: 400, layout: 'fit', items: [mapcomponent] }); var description = ext.create('ext.panel.panel', { contentel: 'description', region: 'south', title: 'description', height: 180, border: false, bodypadding: 5, autoscroll: true }); ext.create('ext.viewport', { layout: 'border', items: [mappanel, grid1, description] }); });
in first lines require
geoext.data.store.features
try instantiate package geoext.data.store
later. try this:
var store = ext.create("geoext.data.store.features", { url: 'http://localhost:8080/geoserver/wms', params: {'layers': 'opengeo:abc'}, autoload: true });
also, try hand on variable olmap
geoext map component. named map
lines above. try:
var mapcomponent = ext.create('geoext.component.map', { map: map });
Comments
Post a Comment