1

I'm trying to add the ArcGIS map service to my project in GeoNode but I'm failing to do so. I've read around and I saw information that says I need to make a XYZ tile service (something like this: http://services.arcgisonline.com/arcgis/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}. So, in the geonode (django) settings there is this by default:

MAP_BASELAYERS = [{
    "source": {"ptype": "gxp_olsource"},
    "type": "OpenLayers.Layer",
    "args": ["No background"],
    "visibility": False,
    "fixed": True,
    "group":"background"
}, {
    "source": {"ptype": "gxp_osmsource"},
    "type": "OpenLayers.Layer.OSM",
    "name": "mapnik",
    "visibility": True,
    "fixed": True,
    "group": "background"
}, {
    "source": {"ptype": "gxp_mapquestsource"},
    "name": "osm",
    "group": "background",
    "visibility": False
}, {
    "source": {"ptype": "gxp_mapquestsource"},
    "name": "naip",
    "group": "background",
    "visibility": False
}, {
    "source": {"ptype": "gxp_bingsource"},
    "name": "AerialWithLabels",
    "fixed": True,
    "visibility": False,
    "group": "background"
}, {
    "source": {"ptype": "gxp_mapboxsource"},
}

This piece of code represent each map that I can use as background. And I'm trying to add the ArcGIS like this>

, {
    "source": {"ptype": "gxp_arcgisworldtopo",
    "name": "ArcGIS.Layer.XYZ",
    "url": "http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}"},
    "fixed": True,
    "visibility": False,
    "group": "background"
}

This fails and shows no error (nothing in console or browser), just doesn't show any of the options at all the map viewer is blank.

Anybody have any idea how to do this?

Just for guiding purposes, here is the link to the ArcGIS World Imagery info: http://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9 and this is the link to the ArGIS REST API: http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer

1

Melvin should've just replayed to the thread on the mailing list... Looks like you invented a new gxp prototype that doesn't exist in gxp_arc...

The proper syntax to use is; source: gxp_olsource with type: OpenLayers.Layer.XYZ You can also add the name as an additional variable like this: "name":"Name",

Heres a full example:

{ "source": {"ptype": "gxp_olsource"}, "type":"OpenLayers.Layer.XYZ", "args":[ "hot", ["http://a.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png", "http://b.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png", "http://c.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png"], {"transitionEffect": "resize","attribution": "osm_attribution"}], "name":"HOT", "visibility": True, "fixed": True, "group":"background" },

  • Yea, I read your post again and I figured it out. Sort of. Type is OpenLayers.Layer.XYZ and the link is http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x} (indifferent if no extension file is given or if I write .jpg or .png) But.. It gives me only the "thumbnail" of the map multiple times, not the interactive map. I was able to connect to that example with no problem. I read ESRI changed some things regarding its REST service, I'm not sure if it helps. And I wrote here to see if I covered more ground. – Melvin Ramos May 27 '15 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.