|
POST
|
Hello everyone, I added a snippet of code that allows for displaying the coordinates on the map as the cursor moves. Right now, the existing coordinates are on OK State Plane North Coordinates. I want to project these coordinates to a WGS 1984 or a Web Mercator (3857) - (see image below and coordinated within red box): I have tried a number of things to reproject these coordinates, but cannot get this to work. I do have a geometry service defined within the application. Things I have tried include: new ProjectParameters also something like this: var geomSer = new GeometryService( ... ); var params = new ProjectParameters({ geometries: [point], outSpatialReference: outSpatialReference, transformation: transformation }); Overall, the API documentation isn't that great or are there any good examples to follow to see how this is done. Here is my current code snippet: // Map - Display Coordinates in Lower Left of Map function displayMapCoords(evt) { var coordinatePoints = mapView.toMap({x: evt.x, y: evt.y}); var XCoordinates = coordinatePoints.x.toFixed(6); var YCoordinates = coordinatePoints.y.toFixed(6); var combinedXYCoordinates = XCoordinates + ", " + YCoordinates; console.log("Oklahoma State Plane North coordinates are (X, Y): ", combinedXYCoordinates); // Display Map Coordinates in Map dom.byId("mapCoordinates").innerHTML = XCoordinates + ", " + YCoordinates; } // Update Coordinates as Mouse Moves mapView.when(function(){ mapView.on("pointer-move", displayMapCoords); }); Are there any suggestions on how to return the coordinates back to a WGS 1984 or Web Mercator projection?
... View more
04-11-2019
08:53 AM
|
0
|
3
|
1400
|
|
POST
|
Robert, Thanks you for the input: I did try the following: // Watch for the Scale on the Extent Change mapView.watch('extent', function(){ console.log("Watch for the current scale: ", mapView.scale); }); This is what I am wanting . Each time the extent changes, the scale refreshes.
... View more
04-04-2019
02:34 PM
|
1
|
0
|
3230
|
|
POST
|
Has anyone been successful getting the map scale to update in console.log when an extent change is performed (through zooming with the mouse event: "zoom-end")? I am looking for a method in the 4.x API that is similar to the following methods using the 3.x API: will update when "zoom-end" is completed. getScale() getZoom() I do have this working in the 3.x environment, but not having much luck using the 4.x API reference. Here is a block of code I used for the 3.x API and it works well: // Return Map Scale Results to Application - Calculation (/12) based on Feet NOT Meters map.on("zoom-end", function() { var returnZoomResult = document.getElementById("zoomToScaleResults"); var scale = map.getScale()/12; var roundScale = Math.round(scale); returnZoomResult.innerHTML = roundScale + " feet"; });
... View more
04-04-2019
01:29 PM
|
0
|
2
|
3941
|
|
POST
|
Robert, That is exactly what I was looking for. Thank you much! I did learn more about the sublayers too . Here is my final coding structure:
... View more
04-04-2019
07:24 AM
|
0
|
0
|
1528
|
|
POST
|
Robert, Thank you much for the resources. I tried this out and got it to work. However, when using the sublayers, it seems to eliminate all the other layers, if you are only specifying one layer. I guess it is all or nothing? In the 3.x environment, I was able to specify the ID of the layer and assign a popup for it, while allowing all layers to display. I guess I need to research this further...trying to learn the differences between the 3x and 4x API.
... View more
04-04-2019
06:45 AM
|
0
|
2
|
1528
|
|
POST
|
Hello. Starting to look at using the 4.x JavaScript API. I am looking to assign a popupTemplate to each layer within a map service. Can I do this without having to add each individual feature layer to the map? I have done this in the 3.x API. Here is my sample below and this works well: electricGPS = new ArcGISDynamicMapServiceLayer("https://arcgis03/arcgis/rest/services/Electric/ElectricGPS/MapServer", { id: "Electric GPS", visible: true, outFields: ["*"] }); // Set Info Template for Electric GPS electricGPS.setInfoTemplates({ 0: {infoTemplate: genericPointsInfoTemplate}, 1: {infoTemplate: poleAttachmentsInfoTemplate}, 2: {infoTemplate: poleInfoTemplate}, 3: {infoTemplate: pedestalInfoTemplate}, 4: {infoTemplate: propertyInfoTemplate}, 5: {infoTemplate: streetlightInfoTemplate}, 6: {infoTemplate: switchingFacilityInfoTemplate}, 7: {infoTemplate: transformerFacilityInfoTemplate}, 8: {infoTemplate: servicePointsInfoTemplate}, 9: {infoTemplate: anchorGuyInfoTemplate}, 10: {infoTemplate: PrimaryMeterInfoTemplate}, 11: {infoTemplate: genericLineInfoTemplate}, 12: {infoTemplate: UGPrimaryInfoTemplate}, 13: {infoTemplate: UGSecondaryInfoTemplate}, 14: {infoTemplate: AreaGenericInfoTemplate} }); How would this work using the 4.x API? Trying to find clues in the API reference. Thank you for any information you can provide.
... View more
04-03-2019
02:23 PM
|
0
|
4
|
1678
|
|
POST
|
Robert, there is a folder named app within the buildOutput folder. Here is a preview: I then copied the contents to the app folder. When launching, it still fails to load, but I seem some interesting errors in console mode. Looks like a referencing issue?
... View more
03-13-2019
06:55 AM
|
0
|
2
|
1159
|
|
POST
|
Robert, I was able to get the script to run and create the build. The zip file was created, then I extracted to an application directory on the server. When launching the application, it just hangs and there are errors in console mode. Really not sure where to go from here. Here are some screenshots: 1. NodeJS Completed Script in Command Prompt 2. Files Created in Application Directory (On Local Machine) 3. Streamlined Application File Structure Following the Extract from the app.zip file 4. Trying to load the application following the extract of the files: I am further compared to where I was, but still no results. My workflow is pretty simple: 1. I created the applications on my local machine, customize it as needed, and add in custom widgets. 2. Following the creation of the application, I deploy to a server and it works This build process is not really intuitive. It would be nice to have some screenshots in prepping the dependencies and etc. I am sure it is a nice utility when it runs.
... View more
03-13-2019
06:23 AM
|
0
|
4
|
1159
|
|
POST
|
Robert, thank you much for your extensive help. I am getting further as I was able to create the package.json file through the nodejs command prompt. I am here: Add the following to your package.json's scripts object "build": "esri-wab-build" (Note: an optional parameter can be added to build a remote web app builder app. For Example: "esri-wab-build C:\arcgis-web-appbuilder-2.7\WebAppBuilderForArcGIS\server\apps\3" ) When I open the package.json file, I have the following block of code: I add "build": "esri-wab-build" to this block? I tried that, then tried to run" npm install npm run build That created the dist folder, but no builtOut folder within.
... View more
03-12-2019
01:15 PM
|
0
|
6
|
1159
|
|
POST
|
Alright, I decided to re-install nodejs to make sure everything is OK. So, starting from step #1: 1. Navigate to the application to be built 2. Create a project.json file (if one does not exist): npm init So now where do I go from here?
... View more
03-12-2019
09:26 AM
|
0
|
8
|
1159
|
|
POST
|
OK, thanks for the help so far, this is a learning experience and something new for me. Trying to document this as I go. So when following the steps 1. Navigate to the application to be built (I go through the file structure): There is no package.json, yet. 2. Create a project.json file (if one does not exist): npm init or do I create the file manually like in a notepad++?
... View more
03-12-2019
08:12 AM
|
0
|
12
|
2097
|
|
POST
|
Robert, I have the nodejs command prompt: In the regular CMD prompt, I did install Bower: So now do I go to the nodejs command prompt?
... View more
03-12-2019
07:45 AM
|
0
|
14
|
2097
|
|
POST
|
Hello Robert, I did install Nodejs yesterday afternoon. Do I need to go to the following location to get Bower? is that a local install as well? https://bower.io/ I just ran the command: I do have Java version 8 installed. I am not sure what Git is I guess when I get all these components installed, I go to the command prompt? That is where I am getting stuck. Install instructions for the pre-requisites would be useful. Thank you for your help.
... View more
03-12-2019
07:15 AM
|
0
|
16
|
2097
|
|
POST
|
I am trying to get this package to work, but having difficulties getting started. I found out a new way on how improve the performance of WAB applications. I was referred to this documentation: https://github.com/gbochenek/esri-wab-build/ I see the steps to follow, but not able to get these commands to run in command prompt. Which command prompt should I be using? Are there any screenshots that somebody can provide, so I can follow along? Would love to give this a try . My web app builder is installed at: C:\GIS\arcgis-web-appbuilder-2.11\WebAppBuilderForArcGIS Any help will greatly be appreciated.
... View more
03-11-2019
02:45 PM
|
1
|
18
|
3784
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-01-2022 05:53 AM | |
| 1 | 09-18-2018 06:17 AM | |
| 1 | 06-19-2018 10:31 AM | |
| 1 | 05-15-2018 10:42 AM | |
| 1 | 10-14-2015 03:59 PM |
| Online Status |
Offline
|
| Date Last Visited |
06-10-2025
07:13 AM
|