POST
|
I was seeing a faint white outline. I now realise it is the setup of the SimpleFillSymbol. Thank you for activating my brain.
... View more
09-09-2014
07:07 AM
|
0
|
0
|
224
|
POST
|
I am performing a Query on a map service using the QueryTask. I get the featureset back without problems. I can also add the features to the map however the graphic added to the map has no fill colour as I would see it if viewing with a dynamic service layer for example. What am I missing? I hope you understand the question?
... View more
09-09-2014
06:48 AM
|
0
|
2
|
620
|
POST
|
Thanks. The reason for having a feature layer was to use the infoTemplate property, which is not available in a dynamic layer. I may have to drop this idea. Thanks.
... View more
06-10-2014
12:52 AM
|
0
|
0
|
276
|
POST
|
I am using the ArcGISDynamicMapServiceLayer to display some labels and FeatureLayer objects to display shapes. Both are added to the same map object but the ArcGISDynamicMapServiceLayer graphic is always beneath the FeatureLayer graphic. I have tried map.reorder() but that does not work. I also tried adding one layer before the other but to no avail. I can set the opacity of the FeatureLayer but I don't really want to do that as it makes it difficult to see. What am I missing? Thanks
... View more
06-09-2014
09:02 AM
|
0
|
3
|
1871
|
POST
|
My colleague miraculously has found a workaround for displaying this WMS with the basemaps. Just before the WMSLayer object is added as a layer to the map, you overwrite the spatialReferences array in the WMSLayer object setting the CRS to 3857 wmsLayer.spatialReferences[0] = 3857 after this is done now add the layer to the map and hey presto the WMS layer appears. In the background this forces a change to one of the attributes that is set on the WMS url from &CRS=EPSG:102100
TO
&CRS=EPSG:3857
Here is the bit of code in full
function addBGS(WMSLayer,WMSLayerInfo,Extent,lang){
var layerInfo = new WMSLayerInfo({name:"GBR_BGS_625k_BLS",title:"GBR BGS 1:625k Bedrock Lithology"});
var resourceInfo = {
extent: new Extent(-8.64846,49.8638,1.76767,60.8612,{wkid: 4326}),
layerInfos: [layerInfo]
};
var wmsLayer = new WMSLayer("http://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/wms",
{
resourceInfo: resourceInfo,
visibleLayers: ["GBR_BGS_625k_BLS"]
}
);
wmsLayer.spatialReferences[0] = 3857;
map.addLayer(wmsLayer);
}
If we do not set the spatialReferences array as above, we get the response error message below
HTTP/1.1 200 OK
Date: Thu, 29 May 2014 13:02:01 GMT
Server: Apache
Access-Control-Allow-Origin: *
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/xml
278
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">
<ServiceException code="InvalidSRS">
msWMSLoadGetMapParams(): WMS server error. Invalid CRS given : CRS must be valid for all requested layers.
msProcessProjection(): Projection library error. proj error "no options found in 'init' file" for "init=epsg:102100"
</ServiceException>
</ServiceExceptionReport>
0
Anyway that's where I am at the moment, hope this helps someone and thanks Jeff. Regards Daniel
... View more
05-29-2014
05:27 AM
|
1
|
1
|
874
|
POST
|
i can tell by your extent that they are not (wkid 4326). that is wgs 84 (lat long). You need to be in web mercator auxiliary sphere HI, I've was away for a few days. I am not the publisher of the WMS service. Also it seems I can only view the layers if spatialReference set to wgs84(4326), in this setting I cannot display a world map from ESRI. This being the case, I have two questions: Can I convert a wgs84 service to 3857/102100 in the javascript side, or via the url parameters? Is my only other option to use a proxy Thanks for the help so far! Daniel
... View more
05-28-2014
08:18 AM
|
0
|
0
|
1705
|
POST
|
Hi Jeff Not too certain how the coordinate system is used so may have to do some reading before I can answer.
... View more
05-22-2014
08:39 AM
|
0
|
0
|
1705
|
POST
|
try 1.create the map without the basemap 2. manually add the basemap 3. basemap.on('load', <add wms>) Hey Jeff, Tried but to no avail, also set a timeout (5secs) before creating the WMSLayer just to be sure but no joy also, strange problem Theres a chocolate bar waiting if this one is solved!!! Thanks
... View more
05-22-2014
07:53 AM
|
0
|
0
|
1705
|
POST
|
Hello Jeff, I tried your suggestion but it did not work. The load event seems to be triggered before the basemap is displayed so im thinking maybe there is another event that could be set instead, assuming that this is the right track. Thanks, more ideas pls.
... View more
05-22-2014
07:12 AM
|
0
|
0
|
1705
|
POST
|
I have found that if my map object has a basemap property set then the WMSLayer does not display when retrieving by resourceInfo method. When I do not set the basemap property then the WMSLayer is displayed. This is not very useful as I need to see the basemap. I dont know if this is a bug or me, I have no solution at the moment so any help greatly appreciated. Here is the url 'http://npdwms.npd.no/NPD_FactMap.asp' and layer is 'Quadrants' I tried setting the visibility to no avail. I do not have this problem when retrieving by proxy method but I would rather use the resourceInfo method Here is my code <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Map with WMS</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
<style>
html, body, #map {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
body {
background-color: #FFF;
overflow: hidden;
font-family: "Trebuchet MS";
}
</style>
<script src="http://js.arcgis.com/3.9/"></script>
<script>
var map;
require(["esri/map", "esri/layers/WMSLayer", "esri/config","esri/layers/WMSLayerInfo","esri/geometry/Extent","esri/layers/FeatureLayer"],
function(Map, WMSLayer, esriConfig, WMSLayerInfo,Extent,FeatureLayer,parser) {
map = new Map("map", {
extent: new Extent({xmin:-8.64846,ymin:49.8638,xmax:1.76767,ymax:60.8612,spatialReference:{wkid:4326}}),
zoom: 2,
// basemap: "streets"
});
addNorway(WMSLayer,WMSLayerInfo,Extent);
addBGS(WMSLayer,WMSLayerInfo,Extent);
});
function addBGS(WMSLayer,WMSLayerInfo,Extent){
var layer20 = new WMSLayerInfo({name:"GBR_BGS_625k_BLS",title:"GBR BGS 1:625k Bedrock Lithology"});
var resourceInfo20 = {
extent: new Extent(-8.64846,49.8638,1.76767,60.8612,{wkid: 4326}),
layerInfos: []
};
var wmsLayer20 = new WMSLayer("http://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/wms",
{
resourceInfo: resourceInfo20,
visibleLayers: ["GBR_BGS_625k_BLS"]
}
);
map.addLayers([wmsLayer20]);
wmsLayer20.setVisibility(true);
}
function addNorway(WMSLayer,WMSLayerInfo,Extent){
var layer10 = new WMSLayerInfo({name:"Quadrants",title:"NO Quads"});
var resourceInfo10 = {
extent: new Extent(-10.0,50.0,20.0,65.0,{wkid: 4326}),
layerInfos: [layer10],
version:"1.1.1"
};
var wmsLayer10 = new WMSLayer("http://npdwms.npd.no/NPD_FactMap.asp",
{resourceInfo: resourceInfo10,
visibleLayers: ["Quadrants","pl_all","Fields","Exploration","Development"]
}
);
map.addLayers([wmsLayer10]);
}
</script>
</head>
<body>
<div id="map">
</div>
</body>
</html>
... View more
05-22-2014
06:42 AM
|
0
|
12
|
6987
|
POST
|
I have found that if your map object has a basemap property set then the WMSLayer does not display when retrieving by resourceInfo method. When I do not set the basemap property then the WMSLayer is displayed. This is not very useful as I need to see the basemap. I dont know if this is a bug or me, I have no solution at the moment so if you know how to get round this please drop a line. Here is the url 'http://npdwms.npd.no/NPD_FactMap.asp' and layer is 'Quadrants' Here is my code <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Map with WMS</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
<style>
html, body, #map {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
body {
background-color: #FFF;
overflow: hidden;
font-family: "Trebuchet MS";
}
</style>
<script src="http://js.arcgis.com/3.9/"></script>
<script>
var map;
require(["esri/map", "esri/layers/WMSLayer", "esri/config","esri/layers/WMSLayerInfo","esri/geometry/Extent","esri/layers/FeatureLayer"],
function(Map, WMSLayer, esriConfig, WMSLayerInfo,Extent,FeatureLayer,parser) {
map = new Map("map", {
extent: new Extent({xmin:-8.64846,ymin:49.8638,xmax:1.76767,ymax:60.8612,spatialReference:{wkid:4326}}),
zoom: 2,
// basemap: "streets"
});
addNorway(WMSLayer,WMSLayerInfo,Extent);
addBGS(WMSLayer,WMSLayerInfo,Extent);
});
function addBGS(WMSLayer,WMSLayerInfo,Extent){
var layer20 = new WMSLayerInfo({name:"GBR_BGS_625k_BLS",title:"GBR BGS 1:625k Bedrock Lithology"});
var resourceInfo20 = {
extent: new Extent(-8.64846,49.8638,1.76767,60.8612,{wkid: 4326}),
layerInfos: []
};
var wmsLayer20 = new WMSLayer("http://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/wms",
{
resourceInfo: resourceInfo20,
visibleLayers: ["GBR_BGS_625k_BLS"]
}
);
map.addLayers([wmsLayer20]);
wmsLayer20.setVisibility(true);
}
function addNorway(WMSLayer,WMSLayerInfo,Extent){
var layer10 = new WMSLayerInfo({name:"Quadrants",title:"NO Quads"});
var resourceInfo10 = {
extent: new Extent(-10.0,50.0,20.0,65.0,{wkid: 4326}),
layerInfos: [layer10],
version:"1.1.1"
};
var wmsLayer10 = new WMSLayer("http://npdwms.npd.no/NPD_FactMap.asp",
{resourceInfo: resourceInfo10,
visibleLayers: ["Quadrants","pl_all","Fields","Exploration","Development"]
}
);
map.addLayers([wmsLayer10]);
}
</script>
</head>
<body>
<div id="map">
</div>
</body>
</html>
... View more
05-22-2014
06:35 AM
|
0
|
0
|
662
|
POST
|
Hello Rahul, Thnak you for you help. I can now display the WMS map using the resourseInfo. However if I set the baseMap of my map object to 'streets' the WMS map does not show anymore. Not sure why that would be, I only have one layer
... View more
05-22-2014
02:56 AM
|
0
|
0
|
431
|
POST
|
Hello, I am asking if there is a way to create a WMSLayer from a WMS url. I am under the following constraints A) I cannot use the proxy solution as our production infrastructure does not allow outbound communications B) The WMS URL is not within our network domain, so I am facing 'same site origin policy' issues Does anyone know of another way to consume an external WMS service. Secondly, if I do, somehow, get the XML data from the WMS service, is there a way to create the WMSLayer object by supplying the raw XML data and no URL. Most appreciated. Daniel
... View more
05-21-2014
08:08 AM
|
0
|
2
|
915
|
Title | Kudos | Posted |
---|---|---|
1 | 05-29-2014 05:27 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|