Updated post:
Here is my pictometry widget. It's just a way to open a link in a new window to your Pictometry.
Demo link ArcGIS Web Application
GitHub link to code: kevinsagis/Pictometry-for-WebApp-Builder · GitHub
Per the Read Me I will look into building the option to put Pictometry imagery into the popup inline as well. I've already had success putting video and other stuff in popups so hopefully this won't be too bad. Note also the capability to use your organization's internal EFS viewer with this as well! We use this as well as the Connect Online on Pictometry's cloud. Instructions for both of these implementations are below, including how to use the required php file.
Here's a Streetview widget that operates similarly:
Demo app link : ArcGIS Web Application
GitHub link - kevinsagis/Streetview · GitHub
***Update 5/18: New update posted. You can directly enter your server URL in the WebApp Builder in the widget configuration setup. For now it's just the Pictometry Online Connect (IPA). I will add the internal link field later today or tomorrow. See the Read Me.txt included for the common URL path formatting for Pictometry.
Cheryl Coley and Adam Gebhart , the Pictometry "IPA Viewer" also known as "Connect" is a different setup than the internal EFS Viewer (which provides height and other tools for internal use only).
For IPA/Connect, here is what you do.
1. Install PHP on your server.
2. Get Pictometry to supply you with: API Key, Secret Key, IPA Load URL and Javascript Library URL. The last paramater to set up in PHP is the Host URL which is your site, such as www.sagis.org
The standard path is http://yoursite/php/ipa.php. So, when it gets passed the latitude, longitude, and credentials, it displays a URL like the folllowing: http://www.sagis.org/php/ipa.php?lat=32.058961097836026&lon=-81.18424499511575
And remember, this Host URL must match what you gave to Pictometry. Each time they generate a key it is for your site. So if you asked them to provide a key for www.MyCountyWebsite.com you can't use it for MySecondSite.com it has to be for www.MyCountyWebsite.com. Therefore we had to two request two keys, one for our testing site and one for the production site.
3. Add the following php file IPA.php to your php folder in your website folder -- Pictometry-for-WebApp-Builder/IPA.php at master · kevinsagis/Pictometry-for-WebApp-Builder · GitHub
Part 2: EFS Viewer
---------------------------
Now... for those of you on the Internal EFS Viewer:
Below are instructions (provided by Pictometry and posted with permission) for getting the token out of your SQL Server in order to embed into your Javascript code that passes credentials into the URL in the new window opened by my Pictometry Widget. Disclaimer: for either EFS or IPA refer to Pictometry tech support for any questions/comments/concerns and I take no liability for any use of either of these instruction sets or the widget code, yada yada. Pictometry has provided excellent support by the way if anyone needs to contact them.
Implementing a Pictometry Server Edition link with Embedded Credentials
As designed, it is necessary for all users of the Server Edition POL Web Solution to enter credentials to allow access to the application. This works fine under most circumstances, but for some groups (such as public access), it is not always possible to create unique login credentials to allow access across a broad number of users.
A work-around to enable simplified access is to create a link to the Server Edition application with the login ID and password embedded, allowing the user to simply click on the link. The URL will contain both the path to the Server Edition application, the user ID, and the password in an encrypted format.
This process can be used for both one user and multiple users using an account that allows concurrent login’s1. It would be challenging to maintain such links for individual users due to the need to enter the back-end database to obtain the encrypted user password, particularly if there is a mandate to change passwords periodically.
The instructions presume the use of MySQL Server 5.1 as the back-end database for Server Edition. If your implementation utilizes another database server (Oracle 11g, MS SQL Server 2008), the principles are similar but the location of certain tools and commands may be different; it may be necessary to consult with your database administrator to obtain the required information.
In order to implement a link with embedded credentials, please do the following;
Identify the Encrypted Credentials
Create the Link with Embedded Credentials
https://serverURL/efs/default.php?user=abc%40xyz.com&pass=5f4dcc3b5aa765d61d8327deb882cf992
1 Please see your Server Edition Administrative Training material for information on how to create an account that allows concurrent logins, and limitations of those accounts.
2 ‘ServerURL/efs’ would be replaced with the URL to access the Server Edition application in your environment, ‘user=’ needs to be populated with the e-mail formatted user ID of the designated user(s), and ‘pass’ would be populated with the encrypted password for that account derived from the database.
Kevin MacLeod, thanks Kevin for working further on this and contacting Pictometry for further assistance.
I've been able to have the onclick work and open a new window where the Pictometry navigation bar loads. However, I am getting some really odd lat/long coordinates in my URL and receive a message like that below:
I should be getting something along the lines of lat = 41.xxxx and long = -91.xxxx, but I get coordinates of lat = 5.xxxx and long = 19.xxxx. That puts me in the Central African Republic. I'm in the Upper Midwest so I don't think I want coordinates for something in Africa.
Have you seen or heard of any problems similar to mine? I don't have any issues like this with our Flex viewer and its Pictometry widget. Also, the map services are the same for both the Flex and WAB sites, but with different names. In my WAB version I have added the GCS_WGS_1984 (4326) option to my coordinate widget and the results I get when clicking on a specific location in my area are correct.
Maybe there is something wrong with my map services used in WAB? Could there be a setting WAB that's throwing me off? I thought I may have accidentally edited your widget.js or ipa.php files, causing my problem. So, I replaced my files with new copies from your github page, then changed my keys, etc. to what Pictometry gave me. The problem persists.
Good afternoon Adam,
I just posted an update. All you need to do is paste your server URL in. It's for the Pictometry Online/Connect cloud-based IPA. The standard path they use, for this and for internal, are described in the Read Me.
As to the coordinates, it seems like a projection issue. I can say, both Pictometry viewers use WKID 4326. Which is GCS_WGS_1984 as you know.
The relevant code in the IPA/Connect viewer you are using is: (converting toGCS84)
var pt = esri.geometry.webMercatorToGeographic(evt.mapPoint);
Also note that for internal EFS users, it's just included right in the URL string as follows:
var url = 'https://Your.Internal.Machine/efs/default.php?'+ 'lat=' + pt.y + '&lon=' + pt.x + '&inSR=2239&outSR=4326&' + 'user=USERNAME%40COMPANYNAME.com&pass=INSERT_TOKEN' ;
Where 2239 is our WKID (eastern GA) and yours would be for your state or projection you are using.
If you post a test site Adam I can take a closer look.
Kevin MacLeod, thanks again for the response.
I've been in contact with somebody from Pictometry and it does sound like there may be an issue with the coordinate system and not having a conversion to WGS-1984 to set up. I have a little bit of research to do with the code of our Flex site Pictometry widget to see if there is a conversion or transformation in it and apply it for WAB.
I do have my URL placed in line 25 of Widget.js, so that should be good to go. I have also played with the esri.geometry.webMercatorToGeographic code and changed it to geographicToWebMercator and lngLatToXY(long, lat) and xyToLngLat(x,y) just to see if any of them would work. Batting .000 there too.https://developers.arcgis.com/javascript/jsapi/esri.geometry.webmercatorutils-amd.html#xytolnglathttps://developers.arcgis.com/javascript/jsapi/esri.geometry.webmercatorutils-amd.html#xytolnglat
If you'd like to check it our (temporary) site go ahead. I'll try to make sure I keep this active. Our WKID = 3418
Hi Adam,
Was it was Bob K. at Pictometry? If so you are in good hands. He helped me immensely on getting this all set up and is great to work with. Also I will probably be at the Pictometry FutureView conference, if anyone's attending.
Yes, typically reversing coordinates lands you in west Africa but I think as you are getting to, there's a projection transformation issue. I think I know what the problem is:
//// this line of code /// var pt = esri.geometry.webMercatorToGeographic(evt.mapPoint); /////////
It is assuming your map was in web mercator. It's in Iowa State Plane ft isn't it. By the way that is a nice looking site.
I will revise my code to take whatever the given map projection is and translate it. I am thinking this might help me us.
Convert coordinates | ArcGIS API for JavaScript
I'll keep you updated on its progress but I believe that's the only thing that we have to fix and we'll be all set!
- Kevin
Kevin,
No, it wasn't Bob K. but thanks for passing along the name. I'll continue looking into things on my end and I might see if I can get something to work with the sample code (link) you posted.
Again, thanks for all of your help. This widget will be used quite often by our staff and general public users. Your work and assistance is very much appreciated.
Adam
@Kevin Macleod
Have you been able to work more on the Pictometry widget? I haven't had much time myself and was curious if you had made any progress with the state plane to WGS 1984 conversion. Thanks.
Adam
Adam,
Have you seen Kevin's blog for his widgets?
Not sure if this will help but thought I might pass it along.
-Stan
Stan,
No, I had not seen Kevin's blog. Thank you for mentioning it.
I'm afraid I don't see anything that helps me resolve the problem I mentioned above. I'll continue looking into it.
Adam