Use WMS forecast services with WAB

700
0
07-06-2017 08:19 AM
DE_WAZIERESFLORENT
New Contributor

Hi,

I try to use WMS OGC services for weather forecasting i'm able to load the WMS layer but when i move on the map layer follow as a image who is stuck on the top of my screen. I set all the parameters and i can't figurate where is my problem... Here is my code : 

_loadMeteoFranceData : function (MFApiKey){
var requestMapOpts = {
version : "1.3.0",
LAYERS : "TOTAL_WATER_PRECIPITATION__GROUND_OR_WATER_SURFACE",
CRS : "EPSG:4326",
styles : "EAU__GROUND__RADAR_SHADING",
format : "png",
width : "2048",
height : "2048",
BBOX : "38,-12,53,8",
dim_reference_time : "2017-07-04T03:00:00Z",
time : "2017-07-04T04:00:00Z",
token : MFApiKey
};

var urlGetMapArome = "https://geoservices.meteofrance.fr/services/MF-NWP-HIGHRES-AROME-0025-FRANCE-WMS";




var WMStest2 = new WMSLayer(urlGetMapArome,{
format : requestMapOpts.format,
version : requestMapOpts.version,
visibleLayers : [requestMapOpts.LAYERS],
opacity : 0.85,
visible : true,
resourceInfo: {
getFeatureInfoURL: urlGetMapArome,
getMapURL: urlGetMapArome,
layerInfos: [
new WMSLayerInfo({
name: requestMapOpts.LAYERS,
title: "Quantité de précipitations sous forme liquide.",
spatialReferences : new SpatialReference(4326),
allExtents : [new Extent(38,-12,53,8, {wkid: 4326}),
new Extent(4230140.65014,-1345708.40841,5899933.01204,893463.751013,{wkid: 3857})],
extent : new Extent(38,-12,53,8, {wkid: 4326}),
legendURL : "https://geoservices.meteofrance.fr/api/"+MFApiKey+"/MF-NWP-HIGHRES-AROME-0025-FRANCE-WMS?service=WMS&version=1.3.0&sld_version=1.1.0&request=GetLegendGraphic&layer=TOTAL_WATER_PRECIPITATION__GROUND_OR_WATER_SURFACE&style=EAU__GROUND__RADAR_SHADING&format=image/png",
description : "QTé précipitations modele AROME"
})],
extent : new Extent(38,-12,53,8, {wkid: 4326}),

customLayerParameters : {
styles : requestMapOpts.styles,
BBOX :requestMapOpts.BBOX,
CRS : requestMapOpts.CRS,
dim_reference_time : requestMapOpts.dim_reference_time,
time : requestMapOpts.time,
token: MFApiKey
}}
});

_map.addLayer(WMStest2);

0 Kudos
0 Replies