Skip to content
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

Add an example for using an Esri 512x512 tile server in EPSG:4326 #2756

Merged
merged 1 commit into from
Oct 8, 2014
Merged

Add an example for using an Esri 512x512 tile server in EPSG:4326 #2756

merged 1 commit into from
Oct 8, 2014

Conversation

bartvde
Copy link
Member

@bartvde bartvde commented Sep 26, 2014

This shows how to use http://services.arcgisonline.com/arcgis/rest/services/esri_imagery_world_2d/mapserver in ol3.

So currently XYZ sources can only be used with 256x256 right?

@bartvde
Copy link
Member Author

bartvde commented Sep 26, 2014

but I do recall discussion (in the ol3 hangout) about adding tileSize to sources, has this already happened or not as yet?

@elemoine
Copy link
Member

@bartvde
Copy link
Member Author

bartvde commented Sep 26, 2014

ah right, thanks @elemoine then probably the apidoc hasn't been updated in a while:

http://openlayers.org/en/master/apidoc/ol.source.XYZ.html

@bartvde
Copy link
Member Author

bartvde commented Sep 26, 2014

What am I missing here that this does not achieve the same:

var map = new ol.Map({
  target: 'map',
  layers: [
    new ol.layer.Tile({
      extent: projectionExtent,
      source: new ol.source.XYZ({
        url: 'http://services.arcgisonline.com/arcgis/rest/services/ESRI_Imagery_World_2D/MapServer/tile/{z}/{y}/{x}',
        attributions: [attribution],
        resolutions: resolutions,
        projection: projection,
        tileSize: 512
      })
    })
  ],
  view: new ol.View({
    center: [0, 0],
    projection: projection,
    zoom: 2,
    minZoom: 2
  })
});

@bartvde
Copy link
Member Author

bartvde commented Sep 26, 2014

okay maybe this still needs a custom tile url function since it's not a simple x/y/z replace ?

@elemoine
Copy link
Member

elemoine commented Oct 8, 2014

The problem may be related to the fact that an XYZ source (and XYZ tile grid) does not take resolutions. And in your case you need a specific resolutions array. This example is useful I think. Please merge if you also think that using an XYZ source is not possible in that case. Also, comment about that in the example's code may be useful.

bartvde added a commit that referenced this pull request Oct 8, 2014
Add an example for using an Esri 512x512 tile server in EPSG:4326 (r=@elemoine)
@bartvde bartvde merged commit 19cba46 into openlayers:master Oct 8, 2014
@bartvde bartvde deleted the ESRI_Imagery_World_2D branch October 8, 2014 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants