Select to view content in your preferred language

add a tile layer from our own server rest service and geoprocessing service

3049
8
10-05-2015 08:50 AM
abukhan
Occasional Contributor

I need to see an example for adding a tile layer from our own server (cached rest service) using beta4

Also need to see an example to run a geoprocessing service and return a geometry using beta4

all examples for 2D only

Tags (1)
0 Kudos
8 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Abu,

Here is an example of using the ArcGISTileLayer:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
  <title>ArcGISTiledLayer</title>

  <link rel="stylesheet" href="https://js.arcgis.com/4.0beta1/esri/css/esri.css">
  <script src="https://js.arcgis.com/4.0beta1/"></script>

  <style>
    html,
    body {
      padding: 0;
      margin: 0;
    }
  </style>

  <script>
    var map;

    require([
        "esri/Map",
        "esri/views/MapView",

        "esri/layers/ArcGISTiledLayer",

        "dojo/domReady!"
      ],
      function(
        Map, MapView,
        ArcGISTiledLayer
      ) {
          
        var tiled = new ArcGISTiledLayer({
          url: "http://tiles.arcgis.com/tiles/dlFJXQQtlWFB4qUk/arcgis/rest/services/Philadelphia2014/MapServer"
        });


        map = new Map({
          layers: [tiled]
        });

        var view = new MapView({
          container: "viewDiv",
          map: map
        });
       
        map.add(tiled);

      });
  </script>
</head>

<body>
  <div id="viewDiv"></div>
</body>

</html>
abukhan
Occasional Contributor

Hi

I appreciate.

Did you have chance to look for the geoprocessor service request call that will return a geometry ?

Thanks.

Abu Khan

Senior Computer Applications Analyst

Division of Information Technology

202-974-7036

0 Kudos
KristianEkenes
Esri Regular Contributor

Geoprocessor is not supported in the 4.0 beta 1 API.

0 Kudos
abukhan
Occasional Contributor

HI:

Any idea about what time geoprocessing will be included (beta2 or release and approx. dates).. We are working on a project that needs geoprocessing…

Another issue, can earlier api (3.4) can be used in addition to api 4 (can both be used same time in the same page) to get some functionalities from both api…?

Thanks.

Abu Khan

Senior Computer Applications Analyst

Division of Information Technology

202-974-7036

0 Kudos
KristianEkenes
Esri Regular Contributor

The plan is to include Geoprocessor in beta2, which will be released sometime this fall. The specific date of this release has not been determined yet.

Regarding the second question - multiple versions of the API cannot be used in the same app. You'll run into all sorts of issues loading modules. I'm not sure if this is what you're looking for, but you could certainly create two separate apps and load them into the same web page using iframes.

0 Kudos
JssrRR
by
Frequent Contributor

Jake,

I tried adding tiled layer using your example here, I am not getting any errors but the tile layer is not showing up and even the base map toggle is gone,

Could you please take a look at the JSFiddle and let me know, what is wrong here.

http://jsfiddle.net/JSSR/6811p3um/

Thank you.

0 Kudos
KristianEkenes
Esri Regular Contributor

Saloni RR

The problem is you declare two Map instances with the same name. Remove the second one and your app will work with the added layer. Here's the revised fiddle: Working with JavaScript API Beta 4.1 - JSFiddle

JssrRR
by
Frequent Contributor

Thanks for looking at it, Yes I see what was wrong there.

0 Kudos