0

My code so far (JSFiddle)

I want to analyse weather data. I am trying to create a Webmap Application to do so. The App should be based on the JavaScript API 3.18 provided by ArcGIS online. Implemented should be an analysing widget provided by the JavaScript API with the functionality of interpolatePoints

I am not able to load the data into widget. I am using a featureLayer which i am able to visualize on the map as a layer. But I am not able to connect the widget with the datas inside the layer.

Some other details:

  • I am working on 'localhost'.

My code:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Analysis</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.18/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.18/esri/css/esri.css">
<style>
    html,
    body,
    #border-container {
        height: 100%;
        margin: 0;
    }

    .esriAnalysis .esriAnalysisCloseIcon {
        display: none;
    }
</style>
<script src="https://js.arcgis.com/3.18/"></script>
<script>
    require([
        "dojo/ready", "dojo/parser", "esri/urlUtils","esri/Color", "esri/symbols/SimpleMarkerSymbol", "esri/renderers/SimpleRenderer",
        "esri/map", "esri/layers/FeatureLayer", "esri/dijit/analysis/InterpolatePoints",
        "dijit/layout/BorderContainer", "dijit/layout/ContentPane"
    ], function(ready, parser, urlUtils, Color, SimpleMarkerSymbol, SimpleRenderer, Map, FeatureLayer, InterpolatePoints) {
        ready(function() {
            parser.parse();

            var map = new Map("map", {
                center: [13, 55],
                zoom: 6,
                basemap: "dark-gray"
            });

            var pointLayer = new FeatureLayer("http://services.arcgis.com/01Gk9ODQDPg4NrOx/arcgis/rest/services/WU_Data/FeatureServer/0");

            map.addLayers(pointLayer);

            var marker = new SimpleMarkerSymbol({
                "color": [238, 69, 0, 125],
                "style": "solid",
                "size": 8,
                "outline": {
                    "color": [255, 255, 255, 125],
                    "width": 0.5
                }
            });
            var rendererA = new SimpleRenderer(marker);
            pointLayer.setRenderer(rendererA);
            map.addLayer(pointLayer);

            var analysisTool;

            analysisTool = new InterpolatePoints({
                inputLayer: pointLayer,
                portalUrl: "http://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer",
                map: map,
            }, "toolPane");

        });
    });
</script>

  • As per the Tour there should be only one question asked per question. – PolyGeo Nov 27 '16 at 11:01
  • edited my question, so it's focusing on the main problem so far. – obrob Nov 27 '16 at 11:41
  • I think you should still try to ask a specific question rather than just describing a problem but I can see that you have been editing so I'll vote to re-open. – PolyGeo Nov 27 '16 at 11:57
  • It may be blocked because 1) the map is hosted on HTTPS while the CSV comes from HTTP ("mixed content"), or 2) CORS: your map is hosted on another (sub-)domain than the CSV and arcgis.com/sharing/... does not provide the HTTP headers to allow you to request that data. Check your browser's developer tools (F12) for any network related errors – chrki Nov 27 '16 at 12:27
  • it does indeed show me a network error: "Esri.config.defaults.io.proxyUrl has not been set. When you send a request to a CORS-enabled server, move the domain to esri.config.defaults.io.corsEnabledServers." I am running my webapp on localhost. I am not sure how to proceed now. . . – obrob Nov 27 '16 at 14:51

Your Answer

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

Browse other questions tagged or ask your own question.