POST
|
Awesome, thank you! Here is the updated code for the Main Body of the function for completeness sake: var newPin = new Point(lonX, latY, new SpatialReference(4236)); var symbol = this.defaultSymbol; console.log(newPin); var geoService = new GeometryService(this.geometryService); var outSpatialReference = new SpatialReference(this.map.spatialReference); var coordParams = new ProjectParameters(); coordParams.inSR = newPin.spatialReference; coordParams.outSR = outSpatialReference; coordParams.geometries = [newPin]; geoService.project(coordParams,lang.hitch(this, function(result){ var pnt = new Point(result[0]); var graphic = new Graphic(pnt); graphic.setSymbol(symbol); this.map.graphics.add(graphic); var newMapExtent var zoomBuffer = 750 newMapExtent = new Extent(pnt.x-zoomBuffer,pnt.y-zoomBuffer,pnt.x+zoomBuffer,pnt.y+zoomBuffer, pnt.spatialReference) this.map.setExtent(newMapExtent); })) I will mark this as answered, I appreciate your help!
... View more
02-03-2020
09:24 PM
|
0
|
0
|
1737
|
POST
|
Thank you for the feedback. I just tested using your suggestion and coordParams.geometries takes the x and y values along with the spatialReference of newPin. However, the same error is thrown.
... View more
02-03-2020
05:39 PM
|
0
|
2
|
1737
|
POST
|
I've inherited a mapviewer which provides a function that accepts latitude and longitude values, and should then move to that point on the map and place a pin. However, the input x and y come from Google Maps wkid 4326 and I need to convert them to wkid 2357. The function formerly relied on projectionPromise which was throwing web assembly errors in both IE and Chrome. I tried coding around this to use the Geometry Server Project function. Now I receive Uncaught TypeError: a.toJson is not a function. Can somebody save me? dropPin: function(e){ var latY = "" var lonX = "" var alertMessage = "Both Latttitude and Longitude must be entered" if(!this.labelLayer){ this.labelLayer = new GraphicsLayer({id: "labelLayer"}) } if(!this.resultsLayer){ this.resultsLayer = new GraphicsLayer({id: "resultsLayer"}) } if(e.srcElement.dataset.dojoAttachPoint == "DropPinBtn"){ if(this.LatTxt.value == "" || this.LongTxt.value == ""){ alert(alertMessage) return } else { lonX = this.LongTxt.value latY = this.LatTxt.value } } if(parseFloat(latY) && parseFloat(lonX)){ latY = parseFloat(latY) lonX = parseFloat(lonX) if(latY>-90 && latY<90){ if(lonX>-180 && lonX<180){ //Main Body //Create new graphic and symbolize var newPin = {"geometry":{"x":lonX,"y":latY, "spatialReference":{"wkid":4326}} } //var rePin = Projection.project(newPin, this.map.spatialReference) var symbol = this.defaultSymbol; var graphic = new Graphic(newPin); graphic.setSymbol(symbol); console.log(graphic); var featureSet = jimuUtils.toFeatureSet(graphic); jimuUtils.zoomToFeatureSet(this.map, featureSet); //the above successfully re-centers the map, but does not draw the graphic var geoService = new GeometryService(this.geometryService); var outSpatialReference = new SpatialReference(this.map.spatialReference); var coordParams = new ProjectParameters(); coordParams.inSR = newPin.geometry.spatialReference; coordParams.outSR = outSpatialReference; coordParams.geometries = [newPin.geometry.x, newPin.geometry.y]; console.log(coordParams); var newCoords = geoService.project(coordParams); //function fails at the above line of code this.resultsLayer.add(graphic); //this.map.graphics.add(graphic); } else{ alert("Longitude is not within accpetable range of values") } } else{ alert("Lattitude is not within accpetable range of values") } } else { alert("Either lattitude or logitude is not a valid number") } }
... View more
02-02-2020
09:35 PM
|
0
|
4
|
1875
|
POST
|
Unfortunately, no. After each reboot we still have to go through the whole process of unregistering the Portal web adaptor, uninstalling it, rebooting the server again, and then re-install and configure the new web adaptor with Portal. I'm still unsure where Portal's affinity for our server name as opposed to the DNS alias stems from, what corrupts the web adaptor during a reboot, or why re-installing it resolves the issue partially (the redirection still occurs, but the Portal map viewers work again).
... View more
08-15-2019
05:50 PM
|
0
|
2
|
3678
|
POST
|
The server hosting portal has a single hostname, which is different than the alias our ssl certificate is granted for. Users access our web content at alias.domain.com. When the web adaptor was originally installed, it was registered with the alias. Now, with or without the web adaptor installed, the portal login redirects to hostname.domain.com:6443/arcgis/home. After uninstalling and reinstalling the web adaptor, I attempt to re-register it at the alias. This works, and it says you may now login to your portal at https://alias.domain.com/[web adaptor name]. Although our map viewers begin working again after the web adaptor reinstall, attempting to access portal still redirects to hostname.domain.com:6443/arcgis/home. I initially though that the background redirection was breaking our map viewers, but that does not appear to be the case as the redirection is still occurring.
... View more
07-20-2019
02:37 AM
|
0
|
0
|
3678
|
POST
|
I would like to try to close the loop on this in case anyone else has the same experience. From an end user's perspective, the map viewer page throws this error: "Unable to load //alias.domain.com/[portal web adaptor]/sharing/rest/portals/self?f=json status: 0" Through the developer console, I can see two attempts are made to hit self?f=json with the request URL of https://alias.domain.com/[portal web adaptor]/sharing/rest/portals/self?f=json, but the status code is 301 and the response header location is https://hostname.domain.com:7443/sharing/rest/portals/self?f=json. A third attempt is made to reach self?f=json this time with the request URL of https://hostname.domain.com:7443/sharing/rest/portals/self?f=json but the request method is OPTIONS instead of GET, and this is where the page stops loading returning status code 405 method not allowed. We were able to resolve the broken map viewer pages by simply unregistering the web adaptor for Portal, uninstalling and then reinstalling it. Our Portal still redirects away from the alias to hostname, but at least the map viewers load. After a server reboot, it reverted back to the same issue which we rectified again by reinstalling the web adaptor.
... View more
07-18-2019
07:54 PM
|
0
|
2
|
3678
|
POST
|
I have read that a hostname change is not supported with Portal. I have not changed the name of my server, but Portal seems to have decided to change the portal.machine.name in portal-config.properties from DNS alias to the server name. I restored a backup of my server from the day prior and I can see it was changed, but how it was changed I am unsure. I also noticed three urlrewrite.xml files that appear to be updated based off the portal.machine.name. I tried to set those back to the alias, but they were soon overwritten back to the hostname.domain.com. The portal-config.properties has a warning about not modifying it directly, and to use Portal Admin instead, but I do not see anywhere on portal admin where it is determining the portal.machine.name.
... View more
07-12-2019
02:52 AM
|
0
|
0
|
3678
|
POST
|
Additional Info: Windows Server 2016 utilizing IIS Attempted to add {alias}.com as a trusted server within Portal Security Settings This redirection does not happen with any other web services, such as {alias}.com/arcgis/rest/services, so I do not believe there is a widespread DNS issue.
... View more
07-11-2019
08:27 PM
|
0
|
0
|
3677
|
POST
|
I'm running ArcGIS Server and Portal 10.6.1 with a web adaptor configured for each on the same server. Everything was working fine, but suddenly viewer pages are not loading. Upon inspection, I realized that the viewers are being redirected to {servername}.com instead of {alias}.com. On our intranet, {servername}.com does not resolve because it is not secure (our ssl certificate is set to {alias}.com). On the server, when I try to login to Portal, it does the same redirection, away from {alias}.com/portal to {servername}.com:7443/arcgis/home. At first I suspected the web adaptor, but then I tried to login at {alias}.com:7443 and it still redirects. Interestingly, I can login to portaladmin at (alias}.com/portal/portaladmin. I've rebooted the server, tried unregistering and re-registering the web adaptor, added a web context url to system properties (https://{alias}.com/portal), however I keep hitting this redirect problem. Anyone know what may have happened?
... View more
07-11-2019
08:15 PM
|
0
|
12
|
6875
|
Online Status |
Offline
|
Date Last Visited |
02-22-2022
07:44 PM
|