POST
|
how to import calcite into typescript is there a basic example. I'm following this example https://github.com/Esri/calcite-maps. that is I'm converting into typescript. I do not know how to reference or import calcite-maps into typescript for example the js example require has calcite-maps modules is there typings for calcite maps? so after and npm install of the typings, I'm able to do this import CalciteMaps from "calcite-maps/calcitemaps-v0.10" and not the import missing like on screenshot
... View more
06-20-2019
04:13 PM
|
0
|
0
|
413
|
BLOG
|
Your map is fine, but I would already start the habit of setting up your web-map as with different folders for the css, js, widgets, templates..etc. I would add other layers, perhaps allow the user to click on the map and view information on a pop-up, or include other frameworks or you can do it in dojo to include some sort of menu bar where you can have home, about this map information. I guess you can make this web map as complicated as you want...
... View more
06-13-2019
10:53 AM
|
0
|
0
|
239
|
POST
|
follow the example for oauth, https://developers.arcgis.com/labs/javascript/access-services-with-oauth-2/ attempted to write it in typescript, the main.js seems ok or transpiled with no errors, but does not seem to work not sure why I have 404 errors for dojo_en_us.js and main.js even though files are there main.ts import Portal from "esri/portal/Portal"; import OAuthInfo from "esri/identity/OAuthInfo"; import IdentityManager from "esri/identity/IdentityManager"; import Map from "esri/Map"; import MapView from "esri/views/MapView"; import MapImageLayer from "esri/layers/MapImageLayer"; import DomStyle from "dojo/dom-style" import DomAtrr from "dojo/dom-attr"; import On from "dojo/on"; import Dom from "dojo/dom"; // ArcGIS Online or your portal address //const portalUrl = "https://www.arcgis.com/sharing"; const portalUrl = "https://<server>.maps.arcgis.com/"; // subsitute your own client id to identify who spawned the login and check for a matching redirect URI const info = new OAuthInfo({ // appId: "JTpyML5GgvA1jEoo", //*** Your Client ID value goes here ***// appId:"", // removed the appID popup: false // inline redirects don't require any additional app configuration }); IdentityManager.registerOAuthInfos([info]); // send users to arcgis.com to login On(Dom.byId("sign-in"), "click", function() { IdentityManager.getCredential(portalUrl); }); // log out and reload On(Dom.byId("sign-out"), "click", function() { IdentityManager.destroyCredentials(); window.location.reload(); }); IdentityManager.checkSignInStatus(portalUrl).then(function() { DomStyle.set(Dom.byId('anonymousPanel'), "display",'none'); DomStyle.set(Dom.byId('personalizedPanel'), "display", 'block'); }); class DisplayMap { displayMap() { const portal = new Portal(); // Once the portal has loaded, the user is signed in portal.load().then(function() { DomStyle.set(Dom.byId('viewDiv'), "display", 'flex'); const map = new Map({ basemap: "topo" }); const view = new MapView({ container: "viewDiv", map: map, zoom: 14, center: [-118.24,34.05] }); const traffic = new MapImageLayer({ url: 'https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServer' }) map.add(traffic); }); } } IdentityManager.checkSignInStatus(portalUrl).then(function() { DomStyle.set(Dom.byId('anonymousPanel'), "display", 'none'); DomStyle.set(Dom.byId('personalizedPanel'),"display", 'block'); //*** ADD ***// let displaymap = new DisplayMap() displaymap.displayMap(); }); index.html <!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"/> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>ArcGIS JS API Tutorials: Access traffic using OAuth2</title> <link rel="stylesheet" href="https://js.arcgis.com/4.11/esri/css/main.css"> <style> html, body, #viewDiv{ font-family: Avenir Next W00; font-size: 14px; width: 100%; height: 100%; margin: 0px; padding: 0px; } .action { color: blue; cursor: pointer; text-decoration: underline; } </style> <script> var locationPath = location.pathname.replace(/\/[^\/]+$/, ""); window.dojoConfig = { async: true, baseUrl: '.', isDebug: true, packages: [ { name: "app", location: locationPath + "/app" }, "custom", 'dijit', 'dojo', 'dojox' ], selectorEngine: 'lite', tlmSiblingOfDojo: false }; </script> <script src="https://js.arcgis.com/4.11"></script> </head> <body> <div id="anonymousPanel" style="display: block; padding: 5px; text-align: center;"> <span id="sign-in" class="action">Sign In</span> to see live traffic. </div> <div id="personalizedPanel" style="display: none; padding: 5px; text-align: center;"> Welcome <span id="userId" style="font-weight: bold;"></span> - <span id="sign-out" class="action">Sign Out</span> </div> <!-- for the map --> <div id="viewDiv" style="display: none;"></div> <script>require(["app/main"]);</script> </body> </html>
... View more
06-02-2019
10:09 PM
|
0
|
0
|
582
|
POST
|
Have made sure your service url in your webmap are not difference pointing to a different folder name? for example https://arcgis/rest/services/10.7/mapserver for example Have you tried publishing a dummy layer to see if you can see it when you pointed into your web application? Have you restarted IIS?
... View more
05-28-2019
12:24 PM
|
0
|
1
|
663
|
POST
|
Hi I do not know if anyone had this issue, but I keep getting a 404 for webmap.js for esri js 4.11.0 on Angular2 application that I forked. from https://angular-cli-esri-map2.stackblitz.io I have changed the code so I can call a webmap from AGOL, but I get a 404 for webmap.js. I have tried it from a regular typescript small application to make sure the portalItem id:"8e42e164d4174da09f61fe0d3f206641" is valid and it is, however the testing application is not an Angular 2 application.
... View more
05-26-2019
04:48 PM
|
0
|
0
|
305
|
Online Status |
Offline
|
Date Last Visited |
04-14-2021
10:47 AM
|