|
POST
|
i am also trying this way: but nothing shows on screen function chooseBasemap() { console.log(ArcGISRuntimeEnvironment.createObject("Map", {portal: portal,itemId: itemID})); mapView.map = ArcGISRuntimeEnvironment.createObject("Map", {portal: portal,itemId: itemID}); }
... View more
07-27-2020
05:42 AM
|
0
|
2
|
851
|
|
POST
|
I have been trying to access my private topological basemap in my app through btn click and calling chooseBasemap(); fnc. But it does not load my basemap. screen goes blank this is my code below: import QtQuick 2.13 import QtQuick.Controls 2.13 import QtQuick.Layouts 1.13 import QtPositioning 5.8 import QtLocation 5.9 import ArcGIS.AppFramework 1.0 import Esri.ArcGISRuntime 100.6 import "../assets/js/backend.js" as Backend import "../controls" as Controls Page { id: app property string itemID: "my map id" property string tItemId:"topo map id" property real scaleFactor: AppFramework.displayScaleFactor width: parent.width height: parent.height MapView { id:mapView property real initialMapRotation: 0 anchors { left: parent.left right: parent.right top: parent.top bottom: parent.bottom } rotationByPinchingEnabled: true zoomByPinchingEnabled: true // add a basemap Map { id:map item: PortalItem { portal: portal itemId: itemID } } }//End Mapview //! [PortalUserInfo create portal] Portal { id: portal credential: Credential { token: Backend.getMapToken() } Component.onCompleted: { load(); //fetchLicenseInfo(); } onLoadStatusChanged: { if (loadStatus === Enums.LoadStatusFailedToLoad) retryLoad(); } } Row{ anchors.horizontalCenter: parent.horizontalCenter //anchors.margins: 70 * scaleFactor spacing:3 leftPadding: 120 topPadding: 15 Controls.Kbutton { id: satellitebtn width: 100 text: qsTr("SATELLITE") font.weight: Font.Bold Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: 100 borderColor: "#ff7919" font.pixelSize: 14 Layout.preferredHeight: 40 baseColor: "#FF7919" textColor: "#FFFFFF" onClicked: { map.basemap = ArcGISRuntimeEnvironment.createObject("BasemapImagery"); } } Controls.Kbutton { id: topobtn width: 88 text: qsTr("TOPO") font.weight: Font.Bold Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: 100 borderColor: "#ffffff" font.pixelSize: 14 Layout.preferredHeight: 40 baseColor: "#ffffff" textColor: "#333333" onClicked: { chooseBasemap(); } } Image { id: group1 source: "../assets/images/Group1.png" height: 60 width: 60 } } Row{ topPadding: 70 leftPadding: 315 anchors.horizontalCenter: parent.horizontalCenter Image { id: group2 source: "../assets/images/Group22.png" height: 60 width: 60 } } function chooseBasemap() { var newMap = ArcGISRuntimeEnvironment.createObject("Map", {basemap: tItemId}); mapView.map = newMap; mapView.visible = true; } footer: Controls.Kfooter { id:footer } }
... View more
07-27-2020
03:15 AM
|
0
|
3
|
938
|
|
POST
|
Hi Erwin, i have already tried the same, but it still asks for the username and pwd. So i used a temporary access token from ArcGIS for Developers and it worked. But i don't know how to generate oauth token programatically to pass in credentials for different users. If you could help please give any example of how to generate token to pass in my credentials. //! [PortalUserInfo create portal] Portal { id: portal credential: Credential {
token: "my temporary developer dashboard access token" oAuthClientInfo: OAuthClientInfo { oAuthMode: Enums.OAuthModeUser clientId: "myclientid" //replace } } Component.onCompleted: { load(); //fetchLicenseInfo(); } onLoadStatusChanged: { if (loadStatus === Enums.LoadStatusFailedToLoad) retryLoad(); } }
... View more
07-21-2020
10:26 PM
|
0
|
1
|
1293
|
|
POST
|
Generate Token—ArcGIS REST API | ArcGIS for Developers do this work in my example?? I am very confused. Please help. As accessing these private maps will be done by multipse users of our app, so it need to be used without login. Any help is appreciable
... View more
07-21-2020
04:04 AM
|
0
|
0
|
1293
|
|
POST
|
Hi i want to access my maps(private). in my application , but they always ask for the login credentials. I want to make it accessible without login. DO I need to add credential of username and password and token, How to generate token in arcgis to pass in credentials, to access private map without login I used this example to write the below code https://community.esri.com/message/908803-re-simple-app-with-private-webmap?commentID=908803#comment-908803 . This is my code below:- import QtQuick 2.6 import QtQuick.Controls 2.1 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 import QtPositioning 5.3 import QtSensors 5.3 import ArcGIS.AppFramework 1.0 import ArcGIS.AppFramework.Controls 1.0 import Esri.ArcGISRuntime 100.6 import Esri.ArcGISRuntime.Toolkit.Dialogs 100.1 import "assets/js/backend.js" as Backend App{ id: app width: 400 height: 800 property real scaleFactor: AppFramework.displayScaleFactor property string portalUrl: "https://arcgis.com/sharing/rest/content/items/"; property string itemID: "mymapid" //header bar Rectangle { id: titleRect anchors { left: parent.left right: parent.right top: parent.top } height: 50 * AppFramework.displayScaleFactor color: app.info.propertyValue("titleBackgroundColor", "red") Text { id: titleText anchors.centerIn: parent text: app.info.title color: app.info.propertyValue("titleTextColor", "white") font { pointSize: 18 } wrapMode: Text.WrapAtWordBoundaryOrAnywhere maximumLineCount: 2 elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter } }//End Rectangle header MapView { id:mapView property real initialMapRotation: 0 anchors { left: parent.left right: parent.right top: titleRect.bottom bottom: parent.bottom } rotationByPinchingEnabled: true zoomByPinchingEnabled: true // add a basemap Map { id:map item: PortalItem { portal: portal itemId: itemID } //initUrl: portalUrl + itemID } }//End Mapview //! [PortalUserInfo create portal] Portal { id: portal credential: Credential { oAuthClientInfo: OAuthClientInfo { oAuthMode: Enums.OAuthModeUser clientId: "myclientid" //replace } } Component.onCompleted: { load(); //fetchLicenseInfo(); } onLoadStatusChanged: { if (loadStatus === Enums.LoadStatusFailedToLoad) retryLoad(); } } AuthenticationView { id: authView authenticationManager: AuthenticationManager } //! [PortalUserInfo create portal] }
... View more
07-20-2020
09:57 PM
|
0
|
4
|
1398
|
|
POST
|
Hi i m trying to add arcgis online webmap which is private to my appstudio app. I m naive to appstudio. Kindly help
... View more
07-19-2020
11:30 PM
|
0
|
1
|
542
|
|
POST
|
you just have t chnage the rgb here validSymbol = createSymbol([255, 255, 255, 0.3], "solid", 2, [
255,121,5]);
... View more
07-19-2020
11:26 PM
|
1
|
0
|
1232
|
|
POST
|
I think this function works for only intersected boundaries: i used the solution below, and it is working fine. merge.addEventListener('click',function(){ var updatedGeometry=new Array(); graphicsLayer.graphics.map(function(gra){ updatedGeometry.push(new Polygon((gra.geometry))); }); var joinedPolygons = geometryEngine.union(updatedGeometry); graphicsLayer.removeAll(); joinedPolygons.rings.forEach(function(ring) { resultpolygon={type:"polygon",rings:[ring]}; var resultgraphic =new Graphic({ geometry: resultpolygon, symbol: resultsymbol }); graphicsLayer.add(resultgraphic); // console.log(ring); }); });
... View more
07-15-2020
04:35 AM
|
0
|
0
|
4294
|
|
POST
|
jQuery('#main').on('click','.merge_boundary',function(){ var updatedGeometry=new Array(); graphicsLayer.graphics.map(function(gra){ updatedGeometry.push(webMercatorUtils.webMercatorToGeographic(gra.geometry)); }); var joinedPolygons = geometryEngine.union(updatedGeometry);//it returned all polygons as it is, do not merge to make it one console.log(joinedPolygons.rings); addGraphics(joinedPolygons.rings); });
... View more
07-14-2020
06:22 AM
|
0
|
2
|
4294
|
|
POST
|
hi robert, long time to hear from your side... how are you, well thanks for the reply, i already get the union link, but couldn't find any example, if u have any link then pls send.. like i have found this Merge Polygons in JavaScript API 4.14 Do, i need to to loop through all the polygons of a layer, to get its graphics geomtrry
... View more
07-14-2020
05:52 AM
|
0
|
4
|
4294
|
|
POST
|
I want to merge random polygons placed on a graphics layer make a single polygon with only one boundary. Also how to unmerge them.
... View more
07-14-2020
05:35 AM
|
0
|
6
|
4404
|
|
POST
|
yes it may happen sometime you can use through identity manager token = { 'server': settings.countryLayerUrl, 'token': settings.gettoken,// put your token here }; IdentityManager.registerToken(token);
... View more
07-03-2020
03:25 AM
|
0
|
0
|
4286
|
|
POST
|
But i need to find out how to toggle basmap through this method, till now i was using ids, now i am directly using json through restapi to create webmap. Earlier i was toggling like this, any function would be helpful. let LINZ_Topographic_Eagle_NZ = new Basemap({portalItem: {id: "<?=$esri_map_id_nz_topo?>"}}); //NZ - LINZ Topographic function setbasemap(basemap){ webmap.basemap = basemap; } // Click event on Topo Button topoBtn.addEventListener('click', function(){ setbasemap(LINZ_Topographic_Eagle_NZ); } }); //Click event on Satellite button satelliteBtn.addEventListener('click', function(){ setbasemap('satellite'); });
... View more
06-22-2020
01:32 AM
|
0
|
0
|
4286
|
|
POST
|
HI the above code is correct just need to parse json string. jQuery.ajax({ type : "GET", async: false, url : "https://www.arcgis.com/sharing/content/items/mywebmapid/data?f=json&token=mytokengenerated", success: function(webmapJSON) { //parse json string here webmap = WebMap.fromJSON(webmapJSON); //webJson=response; }//End Success });//End Ajax
... View more
06-22-2020
01:28 AM
|
0
|
1
|
4286
|
|
POST
|
Hi, I had followed this example, JS Bin - Collaborative JavaScript Debugging and it did worked, but it is hardcoded. i tried it in my app through this hardcoded it works . But when i tried this property of webmap using my app token and made my webapp private. this link return the below and when i tried to use in webmap it gives the error: return JSON: {"operationalLayers":[],"baseMap":{"baseMapLayers":[{"id":"World_Imagery_2017","layerType":"ArcGISTiledMapServiceLayer","url":"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer","visibility":true,"opacity":1,"title":"World Imagery"},{"id":"VectorTile_7259","type":"VectorTileLayer","layerType":"VectorTileLayer","title":"Hybrid Reference Layer","styleUrl":"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json","isReference":true,"visibility":true,"opacity":1}],"title":"Imagery Hybrid"},"spatialReference":{"wkid":102100,"latestWkid":3857},"authoringApp":"WebMapViewer","authoringAppVersion":"8.1","version":"2.16"} CODE:: esriRequest("https://www.arcgis.com/sharing/rest/content/items/mywebmapid/data?f=json&token=mytokengenerated").then(function(json) { console.log(json); const webmap = WebMap.fromJSON(json); const view = new MapView({ map: webmap, container: "viewDiv" }); Error: dojo.js:253 [esri.WebMap] #load() Failed to load web map d {name: "webmap:invalid-version", message: "Expected major version to be a number, but got ''", details: {…}} I also tried it through other getJSON method and ajax method, it return the same error. But when i tried to use hardcode return JSON directly to access my webmap, it works.. like below code var webmapJSON={"operationalLayers":[],"baseMap":{"baseMapLayers":[{"id":"World_Hillshade_895","layerType":"ArcGISTiledMapServiceLayer","url":"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer","visibility":true,"opacity":1,"title":"World Hillshade"},{"id":"VectorTile_6451","type":"VectorTileLayer","layerType":"VectorTileLayer","title":"World Topographic Map","styleUrl":"https://cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json","visibility":true,"opacity":1},{"id":"geotiffs_6320","layerType":"ArcGISMapServiceLayer","url":"https://services.arcgisonline.co.nz/arcgis/rest/services/LINZ/geotiffs/MapServer","visibility":true,"opacity":1,"title":"NZ - LINZ Topographic","itemId":"126df938335049028779fbab6d298daf","showLegend":true}],"title":"Topographic"},"spatialReference":{"wkid":102100,"latestWkid":3857},"authoringApp":"WebMapViewer","authoringAppVersion":"8.1","version":"2.16"}; var webmap = WebMap.fromJSON(webmapJSON); I don't understand where is the problem, i think they are not accessing my webmap but when i used this return hardcode, my app access these globallly used maps..?? also tried through this code..returns same error. jQuery.ajax({ type : "GET", async: false, url : "https://www.arcgis.com/sharing/content/items/mywebmapid/data?f=json&token=mytokengenerated", success: function(webmapJSON) { webmap = WebMap.fromJSON(webmapJSON); console.log(webmap); //webJson=response; }//End Success });//End Ajax Any help will be appreciable.. Thanks in advance...
... View more
06-20-2020
12:13 AM
|
0
|
2
|
4286
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-28-2020 10:30 PM | |
| 1 | 12-27-2020 09:03 PM | |
| 1 | 05-17-2020 10:15 PM | |
| 2 | 04-21-2020 10:39 PM | |
| 3 | 09-09-2020 08:44 PM |
| Online Status |
Offline
|
| Date Last Visited |
04-30-2024
05:15 AM
|