-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Support ArcGIS Rest Services #3263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for contributing this frequently demanded feature! I'll give it a thorough review tomorrow. In the meantime, if you haven't already, please submit a CLA. |
@@ -4978,6 +4978,104 @@ olx.source.ServerVectorOptions.prototype.logo; | |||
*/ | |||
olx.source.ServerVectorOptions.prototype.projection; | |||
|
|||
/** | |||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined), | |||
* params: Object.<string,*>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is optional, so the type should be (Object.<string, *>|undefined)
Great contribution, thanks @cwgrant! Please address my few minor comments. When done, it would be good to squash the commits into one, with something like git pull --rebase upstream master
git rebase -i HEAD~8 When the text editor opens, replace |
This looks like a great contribution. Thanks for the work on it @cwgrant. Does this source work against cached layers? Not sure exactly the words to use, but I'm talking about resources advertised as a "single fused map cache." What other source types can you imagine we might add for working against ArcGIS services? I'm thinking about the name for this source and wondering what sources we might want to reserve room for in the future. What might a vector source be named? And will there be a non-tiled raster source? Just wanting to make sure current names will make sense in the future. |
If the name |
Thanks for the comments @ahocevar. I have addressed them and attempted to squash the commits together - please let me know if I messed it up. |
Looks like you forgot to You may also want to remove the Other than that, it looks good now. |
I wouldn't be opposed to a stable constructor right now. I just thought we should at least talk about what future sources might be added. And I'm not clear on how "single fused map caches" work with this. |
This source does support cached layers, including single fused map cache, but its usage is not recommended for them since you won't be hitting the cached directly and lose the performance benefits of the cache. This source will grab the tiles from ArcGIS MapServer and ImageServer services by requested dynamic tiles. Both of these services can optionally be configured server side with a cache. The existing XYZ source can be used for cached services (see http://openlayers.org/en/v3.2.0/examples/xyz-esri.js). I added a comment to this affect in the TiledArcGISRest constructor.
A vector source could grab data from an ArcGIS FeatureServer so Feature should be in its name. Adding that capability would likely be similar to WFS, so the source might still be a ServerVector utilizing a new format for ArcGIS feature data. I haven't used WFS on OL3, just OL2 so I may be mistaken there.
Yes, that is a good idea. I hadn't realized that in OL3 the "singleTile" flag doesn't exist any more and there are separate sources for grid/non-grid requests. This would likely be similar to the ImageWMS/TileWMS naming convention, though "Image" = Single Tile seems is a little confusing to me. Additionally, although XYZ does support cached ArcGIS layers, it's possible that a TileArcGISCache layer that extends XYZ could have some value in the future. I can't think of other non-tiled raster sources. Based on this do you think the name TileArcGISRest is still appropriate? There are a lot of different possibilities with ESRI so it's hard to predict the future for naming! I'll update the stable constructor based on further discussion. |
* tileGrid: (ol.tilegrid.TileGrid|undefined), | ||
* maxZoom: (number|undefined), | ||
* projection: ol.proj.ProjectionLike, | ||
* serverType: (ol.source.wms.ServerType|string|undefined), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parameter is not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will remove maxZoom and serverType.
Adding a data source to support ArcGIS Map Server and Image Server. Functionality is similar to the ArcGIS93Rest Layer in OpenLayers 2.
var projWords = projection.getCode().split(':'); | ||
var srid = projWords[projWords.length - 1]; | ||
|
||
params.SIZE = tileSize + ',' + tileSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching these to string references into object so the closure compiler doesn't clobber them.
Any more opinions on the name of this new source? Given #3263 (comment), I think the current name is appropriate. |
Thanks for the additional detail @cwgrant. I agree it's a good name. |
thanks @cwgrant for this great contribution! |
Anybody able to reproduce the issues reported here? |
Seems there is a Retina issue here |
@cwgrant , @ahocevar I am able to request ESRI's image services in tiles. However I would like to request the full image and render it, and not broken into tiles. So something on the lines of imageWMS instead of tileWMS. Current Tiled Code: vm.imageryDisplayLayer = new ol.layer.Tile({
source: new ol.source.TileArcGISRest({
url: feature.ImageService_Server + "/" + feature.ImageService_Service,
params: {
mosaicRule: JSON.stringify({
"mosaicMethod" : "esriMosaicNone",
"where" : feature.ImageService_Key + " = " + feature.ImageService_Value
})
},
}),
opacity: .7
}) Is there a way to request the full image from ArcGIS rest? I tried the static image layer, but it doesn't request new images on zoom. Tiled Grid for ArcGIS Rest api is not sufficient, because rendering rules we are using for the image services need to work on full image. Any ideas? Update So looks like @llambanna tried to add this feature as |
The only reason it wasn't merged was because I didn't jump through the On Fri, 25 Mar 2016, 5:57 a.m. Shaunak Vairagare, [email protected]
|
@llambanna any chance you could clean up the #3880 branch? |
This adds native support for ArcGIS Rest Layers to ol3. Both MapServer and ImageServer services are supported - the ArcGIS Rest API is documented at http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/.
Implementation wise, this is supported by adding a data source, TileArcGISRest, which is similar to the existing WMS source. ArcGIS support is loosely based on the ArcGIS93Rest layer available in OpenLayers 2.13.1. Creating a tile layer using a TileArcGISRest is easy:
This feature is discussed in #654.