Skip to main content
title formatting
Link
nmtoken
  • 13.6k
  • 5
  • 38
  • 89

How to add Add a local geoJsonGeoJSON file as a layer with GeoJsonLayer

added 2 characters in body
Source Link
Marcelo Villa
  • 6k
  • 2
  • 20
  • 39

Uncaught ReferenceError: GeoJsonLayer is not defined I am thinking that I am just using a bad filepath/url in my boundaries variable. Any suggestions on how to get this simple json file added as a layer or how to resolve this error?

I am thinking that I am just using a bad filepath/url in my boundaries variable. Any suggestions on how to get this simple json file added as a layer or how to resolve this error?

Uncaught ReferenceError: GeoJsonLayer is not defined I am thinking that I am just using a bad filepath/url in my boundaries variable. Any suggestions on how to get this simple json file added as a layer or how to resolve this error?

Uncaught ReferenceError: GeoJsonLayer is not defined

I am thinking that I am just using a bad filepath/url in my boundaries variable. Any suggestions on how to get this simple json file added as a layer or how to resolve this error?

Added dependencies
Source Link
gwydion93
  • 1.9k
  • 4
  • 30
  • 64

Uncaught ReferenceError: GeoJsonLayer is not defined I am thinking that I am just using a bad filepath/url in my boundaries variable. Any suggestions on how to get this simple json file added as a layer or how to resolve this error?

I am thinking that I am just using a bad filepath/url in my boundaries variable. Any suggestions on how to get this simple json file added as a layer or how to resolve this error?

require([
  "esri/map",
  "esri/basemaps",
  "esri/dijit/BasemapToggle",
  "esri/layers/ArcGISDynamicMapServiceLayer",
  "esri/tasks/ImageServiceIdentifyTask",
  "esri/tasks/ImageServiceIdentifyParameters",
  "esri/layers/WebTiledLayer",
  "esri/dijit/Search",
  "esri/config",
  "esri/request",
  "esri/tasks/IdentifyTask",
  "esri/tasks/IdentifyParameters",
  "esri/tasks/query",
  "esri/tasks/QueryTask",
  "dojo/json",
  "dojo/promise/all",
  "dojo/domReady!"], function(
    Map,
    esriBasemaps,
    BasemapToggle,
    ArcGISDynamicMapServiceLayer,
    ImageServiceIdentifyTask,
    ImageServiceIdentifyParameters,
    WebTiledLayer,
    Search,
    esriConfig,
    esriRequest,
    IdentifyTask,
    IdentifyParameters,
    Query,
    QueryTask,
    JSON,
    all) {
    ...
    var boundaries = "./region2_boundary.json";
    var geoJsonLayer1 = new GeoJsonLayer({
        data: boundaries
    });
    ...
    map = new esri.Map("map", {
        //basemap: "streets",
        basemap: "topo",
        center: [-66.664513,18.200178], //PR
        zoom: 9,
        layers: [geoJsonLayer1]
    });

EDIT I have added my dependencies above.

Uncaught ReferenceError: GeoJsonLayer is not defined.

I am thinking that I am just using a bad filepath/url in my boundaries variable. Any suggestions on how to get this simple json file added as a layer or how to resolve this error?

var boundaries = "./region2_boundary.json";
var geoJsonLayer1 = new GeoJsonLayer({
    data: boundaries
});
...
map = new esri.Map("map", {
    //basemap: "streets",
    basemap: "topo",
    center: [-66.664513,18.200178], //PR
    zoom: 9,
    layers: [geoJsonLayer1]
});

Uncaught ReferenceError: GeoJsonLayer is not defined I am thinking that I am just using a bad filepath/url in my boundaries variable. Any suggestions on how to get this simple json file added as a layer or how to resolve this error?

require([
  "esri/map",
  "esri/basemaps",
  "esri/dijit/BasemapToggle",
  "esri/layers/ArcGISDynamicMapServiceLayer",
  "esri/tasks/ImageServiceIdentifyTask",
  "esri/tasks/ImageServiceIdentifyParameters",
  "esri/layers/WebTiledLayer",
  "esri/dijit/Search",
  "esri/config",
  "esri/request",
  "esri/tasks/IdentifyTask",
  "esri/tasks/IdentifyParameters",
  "esri/tasks/query",
  "esri/tasks/QueryTask",
  "dojo/json",
  "dojo/promise/all",
  "dojo/domReady!"], function(
    Map,
    esriBasemaps,
    BasemapToggle,
    ArcGISDynamicMapServiceLayer,
    ImageServiceIdentifyTask,
    ImageServiceIdentifyParameters,
    WebTiledLayer,
    Search,
    esriConfig,
    esriRequest,
    IdentifyTask,
    IdentifyParameters,
    Query,
    QueryTask,
    JSON,
    all) {
    ...
    var boundaries = "./region2_boundary.json";
    var geoJsonLayer1 = new GeoJsonLayer({
        data: boundaries
    });
    ...
    map = new esri.Map("map", {
        //basemap: "streets",
        basemap: "topo",
        center: [-66.664513,18.200178], //PR
        zoom: 9,
        layers: [geoJsonLayer1]
    });

EDIT I have added my dependencies above.

added 3 characters in body
Source Link
Marcelo Villa
  • 6k
  • 2
  • 20
  • 39
Loading
Source Link
gwydion93
  • 1.9k
  • 4
  • 30
  • 64
Loading