Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread Anyone with experience of Google Calendar or Google Maps
Sun, Feb 10 2013 7:47 AMPermanent Link

Adam Brett

Orixa Systems

I have some applications which track farmers. Staff visit farmers to check their crops.

Office-staff schedule field-staff visits using an EDB application, and field-visit reports are then linked to these visit records for reporting & analysis.

As field staff are starting to use smart phones there is a call for their field-visit schedules to be updated to Google calender.

Also, it would be great if the locations of the farms they were visiting could be shown on google maps.

I have all the data on an EDB server on the cloud, so I am hoping to write an application which can write directly from this server to whatever server google uses for their calendar, and use google maps in a similar way.

I'll be writing this in Delphi (ideally).

Anyone doing similar stuff & know of good components to link EDB-data through to Google?

Advise & gotchas gratefully received.
Sun, Feb 10 2013 8:14 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


Don't know anything personally but the question has been asked a few times over on the emb ngs. I didn't keep track of answers since its not something I want at present. Might be worth having a look over there.

Roy Lambert
Sun, Feb 10 2013 1:59 PMPermanent Link

Barry

Mon, Feb 11 2013 6:00 PMPermanent Link

Jeff Cook

Aspect Systems Ltd

Avatar

<Adam Brett> wrote in message
news:E31F78CE-C657-4E6E-944E-1A67C820D925@news.elevatesoft.com...
>I have some applications which track farmers. Staff visit farmers to check
>their crops.
>
....
> Also, it would be great if the locations of the farms they were visiting
> could be shown on google maps.
>
....

Hi Adam

I have taken a very simple approach that works fine.  I use an instance of
Internet Explorer but I have considered adding a TWebBrowser to my
application.  Not sure how it would go with rural addresses in your country.

Code below sig.

Cheers

Jeff
--
Jeff Cook
Aspect Systems Ltd
www.aspect.co.nz

=================================================================================================
const
 COUNTRY_CODES = 'AU,NZ';     //These are the valid home country codes of
the users running our app.
 COUNTRIES = 'Australia,New+Zealand';
var
 s: string;
 sl: TStringList;
 i: integer;
begin
 inherited;
 if apmDM.PropertyTable.Active then  // this table has the address details
 begin
   sl := TStringList.Create;
   try
     sl.CommaText := COUNTRY_CODES;
     i := sl.IndexOf(apmDM.CompanyTableCountry.AsString);
     s := 'http://maps.google.co.nz/maps?q='
       + StringReplace(apmDM.PropertyTableStreetNumber.AsString, ' ', '',
[rfReplaceAll])
       + '+' + StringReplace(apmDM.PropertyTableStreetName.AsString, ' ',
'+', [rfReplaceAll])
       + '+' + StringReplace(apmDM.PropertyTableSuburb.AsString, ' ', '+',
[rfReplaceAll]);
     if apmDM.PropertyTableSuburb.AsString <>
apmDM.PropertyTableCity.AsString then
       s := s
         + '+' + StringReplace(apmDM.PropertyTableCity.AsString, ' ', '+',
[rfReplaceAll]);
     if i > -1 then
     begin
       sl.CommaText := COUNTRIES;
       s := s + '+' + sl[i];
     end;
     ShellExecute(Forms.Application.MainForm.Handle, 'open',
       PChar(s), '', '', SW_SHOW);
   finally
     sl.Free;
   end;
 end;

Wed, Feb 13 2013 12:53 PMPermanent Link

Adam Brett

Orixa Systems

Jeff

I hadn't thought of just accessing google maps directly through the front end, that is actually an excellent idea.

I was hoping to be able to create "pins" on the map to mark farmers and their fields (perhaps in different colours).

I have reviewed the Google API, and it is not too horrific. I will most likely find a component to save leg-work, (tMS have one, and there is open source stuff) but the EDB part looks like being very simple:

1 table:

"GoogleDetails"
ID (int)
LinkTable (varchar)
LinkID (int)
Latitude (float to 6 decimal places max 90, min -90))
longitude (float to 6 decimals, max 180, min - 180)
Description
DetailType (used to set colour & perhaps glyph)
MapImage (Blob)
DateCreated
DateEdited
Author
Current

This table can be "joined" to any other in the schema on a join of LinkID + LinkTable.

In the application clicking "link to google" would open a form with the google map shown in a TWebrowser or similar, set to allow zooming etc to "fix" a point.

When the point is fixed a google latitude and google longitude would be "grabbed" & inserted into the  GoogleDetails table row with the table + ID, together with a screen grab of the map (so the system could work off-line).

--

Then SQL could generate lists of points to be shown in any map, together with other linked data draw from the farmer database, etc.

I can see that if the results from these queries were fangled into fairly simple XML the resulting datasets could be used on my clients' web-pages.

--

I will have to find the Google license & read it carefully (Frown... to check how far it is legal to do this without paying google something.
Wed, Feb 13 2013 2:46 PMPermanent Link

Barry


<I will have to find the Google license & read it carefully (Frown... to check how far it is legal to do this without paying google something.>

There is also OpenLayers which is free. I don't know if has all the features you're looking for, but it is one way to bypass the Google "legalese". I had a link to it in my previous post.

Barry
Fri, Feb 15 2013 9:53 AMPermanent Link

Adam Brett

Orixa Systems

Barry

... thanks for the links by the way. The TMS component looks decent & thorough & is not horribly expensive. The various open source components are much more sketchy, so I may pay for the TMS code, but then rip out the bits I need into my own units.

>>There is also OpenLayers which is free. I don't know if has all the features you're looking for, but it is one way to >>bypass the Google "legalese". I had a link to it in my previous post.

I would honestly love to use OpenLayers, but I think my client will be too hooked into the idea of Google.

1 good thing is that as everyone agrees on Latitude and Longitude number values it would actually be pretty easy to write the code to use any mapping layer. And latitudes collected using OpenLayers could be used later to generate data which could be pumped into Google to register them as "Google Places"
Fri, Feb 15 2013 11:29 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam

>.. thanks for the links by the way. The TMS component looks decent & thorough & is not horribly expensive. The various open source components are much more sketchy, so I may pay for the TMS code,

Do be careful with TMS. They have a vast number of components, some very good, but tend to suffer from a permanent state of bug fix -> new bug or implement customer request -> introduce bug in different area. But things may have changed since I bought them. I'm working on my own toolbar to replace theirs right now.

>but then rip out the bits I need into my own units.

This can be trickier than you might think. I've always struggled to follow their code which may be due to me or not.

Roy Lambert
Mon, Feb 18 2013 4:47 AMPermanent Link

Adam Brett

Orixa Systems

>>Do be careful with TMS. They have a vast number of components, some very good, but tend to suffer from a >>permanent state of bug fix

Agreed!

I have gone ahead & bought their google components though. The Google API is extremely clear & well laid out & TMS have really only had to map this across to Delphi, so there wasn't much they could do wrong & it would have taken me many hours to duplicate even part of their work ... so it is definitely worth the money.

I'll report back on it & would happily post up any units & create to manage Google-maps stuff here if you are interested.
Mon, Feb 18 2013 5:40 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam

<<so there wasn't much they could do wrong>>

Now where have I heard that before Smiley

>I'll report back on it & would happily post up any units & create to manage Google-maps stuff here if you are interested.

I'm always interested and I'm sure others will be as well.

Roy
Image