Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GeoIntegration for Google Maps
07-13-2017, 02:07 AM
Post: #1
GeoIntegration for Google Maps
I am trying to get the GeoIntegration setup and am having some issues.
1. I have my google API setup and entered into the Geocode Maintenance setup and when I Run The Geo Process it will download for about 300 customers of 1300 and displays the results this takes about 2 minutes.
What have down is increased the timeout in the php.ini file and this makes no differance. This on a windows 2008r2 server running IIS 7 and weberp version 4.12.3.
2. When Geocode Integration is enabled in the setup when I try to update the customer branch I get an error url not loading.
The map will load after url not loading and I go back to the customer screen.
I have tried to change the url in customerbranches.php from http to https with the same results.
3. This also happens in the vendors also tried to change the url with no luck.
Any help would be greatly appreciated.
Find all posts by this user
Quote this message in a reply
07-13-2017, 09:07 AM
Post: #2
RE: GeoIntegration for Google Maps
When you say you have increased the timeout do you mean max_execution_time ? I wonder if it is worth changing the code so that it only ran the setup where the lat and lng fields are empty?

The only issue I have with showing the maps is in the SelectSupplier.php script where no map is shown when you first enter the script and no supplier has so far been selected in this session. This is caused by the $_SESSION['SupplierID'] not being set when the javascript function is out put. So lines 70-79 in the latest script need to be moved to before line 19.

Hope this helps,
Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
07-19-2017, 08:08 AM
Post: #3
RE: GeoIntegration for Google Maps
(07-13-2017 09:07 AM)falkoner Wrote:  When you say you have increased the timeout do you mean max_execution_time ? I wonder if it is worth changing the code so that it only ran the setup where the lat and lng fields are empty?

The only issue I have with showing the maps is in the SelectSupplier.php script where no map is shown when you first enter the script and no supplier has so far been selected in this session. This is caused by the $_SESSION['SupplierID'] not being set when the javascript function is out put. So lines 70-79 in the latest script need to be moved to before line 19.

Hope this helps,
Tim

Tim
Thanks for the help I got delayed on working on this.
For the timeout issue i got that fixed by editing the web,config file and adding
<system.web>
<httpRuntime executionTimeout="180" />
</system.web>
This helped for the most part but I changed the code to run by a range of customers and vendors as google has a limit on there end.
I have the maps working for the customers and vendors but now the issue is when i add or update a customer or vendor I get the error

WARNING Message Report : Google map url not loading
Geocode Notice: Address: 1780 BEIDER, , MUSKEGON, MI failed to geocodeReceived status

ALso the geo_displaymap_customers.php and geo_displaymap_suppliers.php will not work have not had a lot of time to look at the code, this part is not as important to get working I attached an image of the pages.
Thanks


Attached File(s) Thumbnail(s)
       
Find all posts by this user
Quote this message in a reply
07-19-2017, 06:07 PM (This post was last modified: 07-19-2017 06:46 PM by falkoner.)
Post: #4
RE: GeoIntegration for Google Maps
In Suppliers.php lines 425-428 need to be replaced by:

$address = urlencode($_POST['Address1'] . ', ' . $_POST['Address2'] . ', ' . $_POST['Address3'] . ', ' . $_POST['Address4'] . ', ' . $_POST['Address5'] . ', ' . $_POST['Address6']);
$base_url = "http://" . MAPS_HOST . "/maps/api/geocode/xml?address=";
$request_url = $base_url . $address . ',&sensor=true';

Lines 433 to 437 need to be removed

and lines 434-435 need to be changed to:

$status = $xml->status;
if (strcmp($status, 'OK') == 0) {

Lines 438 and 439 should be removed

Lines 441 and 442 should be replaced by:

$latitude = $xml->result->geometry->location->lat;
$longitude = $xml->result->geometry->location->lng;

This should now work for the suppliers. Any problems give me a shout
Tim


Similarly in CustomerBranches.php

Lines 112 to 114 become:

$address = urlencode($_POST['BrAddress1'] . ', ' . $_POST['BrAddress2'] . ', ' . $_POST['BrAddress3'] . ', ' . $_POST['BrAddress4']);
$base_url = "http://" . MAPS_HOST . "/maps/api/geocode/xml?address=";
$request_url = $base_url . $address . ',&sensor=true';

Lines 116 to 120 should be removed.

Lines 117 to 118 become:

$Status = $xml->status;
if (strcmp($Status, 'OK') == 0) {

Lines 121 and 122 should be removed

Lines 122 and 123 should become:

$Latitude = $xml->result->geometry->location->lat;
$Longitude = $xml->result->geometry->location->lng;

Hope this all helps,
Tim

There are several changes throughout this thread that need to be applied to subversion.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
08-06-2017, 05:02 AM
Post: #5
RE: GeoIntegration for Google Maps
Don't think this has been applied yet.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
09-12-2017, 06:49 AM
Post: #6
RE: GeoIntegration for Google Maps
Tim,

My simple mind is struggling to follow your instructions above.
I'm getting mixed up with the Line number references.

Could you reply with the whole sections of affected code please?

e.g Suppliers.php Lines 425 to 442 & CustomerBranches.php Lines 112 to 123

Thanks,

Andy.
Find all posts by this user
Quote this message in a reply
09-12-2017, 08:46 PM
Post: #7
RE: GeoIntegration for Google Maps
Andy I am travelling all day today. I should be able to look at this from Paris tonight (wife willing Smile ) otherwise it will have to wait till I am back in an office.

Thanks
Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
09-12-2017, 09:16 PM
Post: #8
RE: GeoIntegration for Google Maps
No worries, it can wait.
Take your wife somewhere fancy instead!
Find all posts by this user
Quote this message in a reply
09-16-2017, 08:08 PM
Post: #9
RE: GeoIntegration for Google Maps
Hi Andy, I am finally back in the UK and can do this.

I will send the scripts that need changing by email as it is probably easier than posting them here. Please test and verify they work for you - you might have to re-run the geo code setup routine to make them work.

They are done against the latest SVN code and I have verified the maps show on my system.

Thanks
Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
09-19-2017, 08:32 AM
Post: #10
RE: GeoIntegration for Google Maps
Hi Tim,
Tested at my end.
It works perfectly on a production/live server.
I have committed your mods.
Thanks.

BTW, I noticed that geo_displaymap_suppliers.php & geo_displaymap_customers.php do not work from an XAMPP environment (however, the other scripts do work).
Chrome Console error attached.
Not a big issue for me, but wonder if you any thoughts on would causes this. ?

Andy.


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)