AnsweredAssumed Answered

Hi all, I'm a javascript developer, new to ARCgis, and wish to create a map using a mapid my GIS colleague has created in place of the general ESRI map. Would it be something like :    arcgisUtils.createMap("8e42e164d4174da09f61fe0d3f206641", "viewDiv").t

Question asked by Mickeybags on Jun 8, 2017
Latest reply on Jun 8, 2017 by Mickeybags

require([
"esri/Map",
"esri/arcgis/utils",
"esri/views/MapView",
"esri/Graphic",
"esri/geometry/Point",
"esri/symbols/SimpleMarkerSymbol",
"esri/widgets/Search",
"esri/geometry/support/webMercatorUtils",
"dojo/domReady!"
],


function (Map, arcgisUtils, MapView, Graphic, Point, SimpleMarkerSymbol, Search, webMercatorUtils) {


var mapid = "d48f43130de5452ea67650cda98d6def";

arcgisUtils.createMap("8e42e164d4174da09f61fe0d3f206641", "viewDiv").then(function (response) {

var map = response.map;

 

var view = new MapView({ container: "viewDiv", map: map, center: [-7.5, 52.205540], zoom: 10 });
var search = new Search({ view: view });
search.defaultSource.withinViewEnabled = false;
view.ui.add(search, "top-right");

view.on("click", function (evt) {
search.clear();
var markerSymbol = new SimpleMarkerSymbol({ color: [193, 7, 7], outline: { color: [255, 255, 255], width: 2} });
var lat = Math.round(evt.mapPoint.latitude * 10000000) / 10000000;
var lon = Math.round(evt.mapPoint.longitude * 10000000) / 10000000;
var point = new Point({ longitude: lon, latitude: lat });
var pointGraphic = new Graphic({ geometry: point, symbol: markerSymbol });

view.graphics.removeAll();
view.graphics.add(pointGraphic);
});
});
});

 

I'm getting javascript error: init.js:23 GET http://js.arcgis.com/4.3/esri/arcgis/utils.js 404 (Not Found)

 

Thanks

Outcomes