Display the map based on geoserver as using arcgis javascript API WMS?

المشرف العام

Administrator
طاقم الإدارة
I'm developing mapping website, My map is based on geoserver and i need very good Javascript API, that has plenty of functions to develop my website such as direction route etc...So i decided to use Arcgis Javascript API then i faced the problem to use Arcgis Javascript API's wms to show my geoserver map.Help me guys?here is my code to call Arcgis WMS.

var map;require([ 'esri/map', 'esri/layers/WMSLayer', 'esri/layers/WMSLayerInfo', 'esri/geometry/Extent', 'dojo/_base/array', 'dojo/dom', 'dojo/dom-construct', 'dojo/parser', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'dojo/domReady!'], function(Map, WMSLayer, WMSLayerInfo, Extent, array, dom, domConst, parser) { parser.parse(); map = new Map('map', { center: [47.918464, 106.917678], zoom: 10 }); var layer1 = new WMSLayerInfo({ name: 'mongolid:mongolid_map' }); var resourceInfo = { layerInfos: [layer1] }; var wmsLayer = new WMSLayer('http://192.168.100.245:28080/geoserver/gwc/service/wms', { resourceInfo: resourceInfo, visibleLayers: ['mongolid:mongolid_map'] }); wmsLayer.spatialReferences[0] = 32648; map.addLayers([wmsLayer]); var details = dom.byId('details'); domConst.place('Layers:', details); var ul = domConst.create('ul', null, details); array.forEach(wmsLayer.layerInfos, function(layerInfo) { domConst.create('li', { innerHTML: layerInfo.title }, ul); }); domConst.place('WMS Version:' + wmsLayer.version + '
', details);});

أكثر...
 
أعلى