nakijun / morisoliver

Automatically exported from code.google.com/p/morisoliver
0 stars 0 forks source link

Configure OLIVER to accept an address on the Permalink #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Aaron Richer of DEP suggested this enhancement.
They have a database of addresses and it would be handy to be able to open 
OLIVER zoomed to an addresses.  They could create Permalinks out of their 
addresses.

I think the Permalink URL would need several items.
1) an indication of whether the geocode should use the Bing or MassGIS 
Maybe &gcType=Bing or &gcType=MassGIS
2) if Bing the address parameter could simply be &address=value such as 
&address=Fenway Park or &address=1 Ashburton Pl 02108
Since Bing has the address parsing logic to handle free-form addresses.
3) if MassGIS the address parameters will need to be more fixed. The custom 
MassGIS address service has 4 tags: Address, City, ZipCode and State so I 
proposed we use these parameters.  &Address= &City= &Zip= &State=  Since State 
is optional and either City or Zip is optional in the request these could be 
left off the URL.  See more details at the description of the geocoding 
service: 
https://wiki.state.ma.us/confluence/display/massgis/ArcGIS+Server+-+Geocoding

The process of opening OLIVER with a Permalink is that OLIVER will submit the 
address to the appropriate geocoding service and automatically zoom to the 
center.  No pop up box to the user will be provided.  If a "bad" address is 
enter OLIVER can simply open to the defaultBbox specified in the .php, as if no 
address parameters were specified on the Permalink.  No error message is 
required, the composer of the Permalink will need to figure out why the address 
is not geocoding.  Geocoding will take precedence for the zooming over any Bbox 
parameters or zoom levels on the Permalink.  There is no need to change the UI 
to give the user an option to create a Permalink off an address - the current 
Permalink from existing Bbox is sufficient. 

Original issue reported on code.google.com by Aleda.Fr...@state.ma.us on 17 Dec 2012 at 5:29

GoogleCodeExporter commented 9 years ago
Just a heads-up that address searching seems a bit slow (even when the network 
isn't flailing).  If a user hits the site w/ a MassGIS addr query, do you want 
them to have to stare at a blank screen while the query is answered (and then 
the map centers and zooms)?  If not, then the map will need to zoom to the 
defaults defined in the .PHP and THEN fire the addr query.  We could show a 
Locating address... window or something while they wait.  In either case, the 
latency of the service is pretty obvious.

Original comment by cpl...@gmail.com on 24 Jun 2013 at 4:24

GoogleCodeExporter commented 9 years ago
It's true, the MassGIS ArcGIS Server geocoding is about a 6 second proposition 
right now.  We hope to improve that somehow.  I would prefer showing some 
message while they wait as opposed to zooming to one place and then to another.

Original comment by Aleda.Fr...@state.ma.us on 24 Jun 2013 at 4:26

GoogleCodeExporter commented 9 years ago
The problem is that we don't have a mechanism for that.  There is no easy way 
for me to freeze the map and have it wait for defaultCenter to appear.  A 
normal bookmark link works because the position is available at launchtime.

Original comment by cpl...@gmail.com on 24 Jun 2013 at 4:33

GoogleCodeExporter commented 9 years ago
Sorry, I misunderstood what you said as either/or.  I think I get it now.  Zoom 
to the defaults AND show a message while they wait.  OK, that's fine, as 
there's no mechanism.

Original comment by Aleda.Fr...@state.ma.us on 24 Jun 2013 at 4:35

GoogleCodeExporter commented 9 years ago
Starting w/ a MassGIS addr in the bookmark is straightforward since a result 
set will only be a point.  But since Bing will give 2 results, which one should 
a bookmark go to:  center point or region?  Should that be yet another flag?

I'm also assuming that these bookmarks are being created manually and that this 
is not part of the normal bookmark creation button's duties.  I'm also not 
planning on passing these extra flags along to any new bookmarks.  E.g. a user 
arrives at the site w/ a bookmark, uses the app, zooms and pans, and then 
creates a new bookmark.  I'm suggesting that this new bookmark include no 
reference to the extra flags that were used for startup.

Original comment by cpl...@gmail.com on 25 Jun 2013 at 12:05

GoogleCodeExporter commented 9 years ago
See comments for r496.

Original comment by cpl...@gmail.com on 25 Jun 2013 at 1:40

GoogleCodeExporter commented 9 years ago
- I think the bookmark should go to center point, let's keep it simple.
- Yes, bookmarks are being created manually, this is not part of the normal 
bookmark creation button's duties.
- Right - no passing these flags along to any new bookmarks.

Original comment by Aleda.Fr...@state.ma.us on 25 Jun 2013 at 2:14

GoogleCodeExporter commented 9 years ago
So should I rollback the gcZoomTo option?

Original comment by cpl...@gmail.com on 25 Jun 2013 at 2:27

GoogleCodeExporter commented 9 years ago
I tested these in Firefox which worked: (and a few in Chrome, IE and Safari)

http://maps.massgis.state.ma.us/map_ol_to5b/oliver.php?gcType=Bing&gcAddress=1%2
0Ashburton%20Pl,%2002108&gcZoomTo=center

http://maps.massgis.state.ma.us/map_ol_to5b/oliver.php?gcType=Bing&gcAddress=1%2
0Ashburton%20Pl,%2002108&gcZoomTo=region

http://maps.massgis.state.ma.us/map_ol_to5b/oliver.php?gcType=MassGIS&gcAddress=
1%20Ashburton%20Pl&gcZipcode=02108

http://maps.massgis.state.ma.us/map_ol_to5b/oliver.php?gcType=MassGIS&gcAddress=
100%20Willard%20St.&gcZipcode=03071

&gcZoomTo is not applicable to type MassGIS correct? Just want to make sure I 
document it correctly.  It seems to do center whether I specify center or 
region, which is fine.

These don't seem to be working for me?

http://maps.massgis.state.ma.us/map_ol_to5b/oliver.php?gcType=MassGIS&gcAddress=
1%20Ashburton%20Pl&gcCity=Boston

http://maps.massgis.state.ma.us/map_ol_to5b/oliver.php?gcType=MassGIS&gcAddress=
1%20Ashburton%20Pl&gcCity=Boston&gcState=MA

No zooming

It's sending

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GeocodeAddress xmlns="http://tempuri.org/">
<Address>1 Ashburton Pl</Address>
<City>Boston</City>
<ZipCode>undefined</ZipCode>
<State>undefined</State>
</GeocodeAddress>
</soap:Body>
</soap:Envelope>

and it should probably be blank instead of "undefined"

and getting back 

<?xml version="1.0" encoding="utf-8"?><soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GeocodeAddressResponse 
xmlns="http://tempuri.org/"><GeocodeAddressResult><X>NaN</X><Y>NaN</Y></GeocodeA
ddressResult></GeocodeAddressResponse></soap:Body></soap:Envelope>

I don't know why the zipCode example works, because it's also sending some 
undefined

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GeocodeAddress xmlns="http://tempuri.org/">
<Address>100 Willard St.</Address>
<City>undefined</City>
<ZipCode>03071</ZipCode>
<State>undefined</State>
</GeocodeAddress>
</soap:Body>
</soap:Envelope>

but I think if we just use blank for any missing parameters that will take care 
of all of it. 

Original comment by Aleda.Fr...@state.ma.us on 25 Jun 2013 at 8:02

GoogleCodeExporter commented 9 years ago
Sorry you had to do all that detective work.  Thank you.

r506

Original comment by cpl...@gmail.com on 25 Jun 2013 at 9:19

GoogleCodeExporter commented 9 years ago
No problem, Firebug makes it easy.  But I don't see a difference - do you see 
your changes in: http://maps.massgis.state.ma.us/map_ol_to5b/js/map.js ?
r506 commit notes only mention raster changes....

Original comment by Aleda.Fr...@state.ma.us on 26 Jun 2013 at 3:13

GoogleCodeExporter commented 9 years ago
Just to note, I tried the ones that do work in IE, Chrome and Safari and they 
were OK. 

Original comment by Aleda.Fr...@state.ma.us on 26 Jun 2013 at 3:57

GoogleCodeExporter commented 9 years ago
"Ones that do work."  I'm confused.  Are there problems w/ the permalink?

Original comment by cpl...@gmail.com on 26 Jun 2013 at 6:34

GoogleCodeExporter commented 9 years ago
I mean that I don't see the "undefined" problem fixed yet - did you really 
commit it?

Original comment by Aleda.Fr...@state.ma.us on 26 Jun 2013 at 6:37

GoogleCodeExporter commented 9 years ago
Yes, but I don't remember which version.  This block does the undefined 
checking.  Basically, if you don't pass something an empty string is passed 
along to the query.

      massgisAddressSearch({
         street       : launchSearch.address ? launchSearch.address : ''
        ,municipality : launchSearch.city ? launchSearch.city : ''
        ,state        : launchSearch.state ? launchSearch.state : ''
        ,zipcode      : launchSearch.zipcode ? launchSearch.zipcode : ''
        ,url          : toolSettings.massgisAddressSearch.url
      });

Original comment by cpl...@gmail.com on 26 Jun 2013 at 6:40

GoogleCodeExporter commented 9 years ago
I don't see that code here yet:
http://code.google.com/p/morisoliver/source/browse/trunk/js/map.js

Also, you said r506 was fixing undefined, but your commit note only mentions 
fixing the extract.

Original comment by Aleda.Fr...@state.ma.us on 26 Jun 2013 at 6:43

GoogleCodeExporter commented 9 years ago
It's there.  Even on the version before my latest commit.

https://code.google.com/p/morisoliver/source/browse/trunk/js/map.js?r=506#3411

Original comment by cpl...@gmail.com on 26 Jun 2013 at 6:55

GoogleCodeExporter commented 9 years ago
I'm really confused, because when I follow the link in #17 I see:

 if (launchSearch) {
if (launchSearch.gcType == 'MassGIS' && toolSettings && 
toolSettings.massgisAddressSearch && toolSettings.massgisAddressSearch.url) {
massgisAddressSearch({
street : launchSearch.address
,municipality : launchSearch.city
,state : launchSearch.state
,zipcode : launchSearch.zipcode
,url : toolSettings.massgisAddressSearch.url
});
}
else if (launchSearch.gcType == 'Bing' && toolSettings && 
toolSettings.bingAddressSearch) {
bingAddressSearch({
text : launchSearch.address
,zoomToCenter : launchSearch.zoomTo == 'center'
,zoomToRegion : launchSearch.zoomTo == 'region'
});
}
}

which doesn't look like the code you talk about in #15.  Help! 

Original comment by Aleda.Fr...@state.ma.us on 26 Jun 2013 at 7:00

GoogleCodeExporter commented 9 years ago
I agree w/ you!  It was there before.

How about this for a match?

https://code.google.com/p/morisoliver/source/browse/trunk/js/map.js?r=507#3422

Original comment by cpl...@gmail.com on 26 Jun 2013 at 7:04

GoogleCodeExporter commented 9 years ago
Whew!  I see it now, and now it works:

http://maps.massgis.state.ma.us/map_ol_to5b/oliver.php?gcType=MassGIS&gcAddress=
1%20Ashburton%20Pl&gcCity=Boston&gcState=MA

puts a blank (as it should) for ZipCode and the zoom works.

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GeocodeAddress xmlns="http://tempuri.org/">
<Address>1 Ashburton Pl</Address>
<City>Boston</City>
<ZipCode></ZipCode>
<State>MA</State>
</GeocodeAddress>
</soap:Body>
</soap:Envelope>

Original comment by Aleda.Fr...@state.ma.us on 26 Jun 2013 at 7:10

GoogleCodeExporter commented 9 years ago

Original comment by Aleda.Fr...@state.ma.us on 27 Jun 2013 at 2:00