google maps non-web access - delphi

I need to be able to access the Google Maps API from a non-web application. I see in Google Maps' FAQs that this is possible. However, I cannot find any reference to accessing the API from a PC-based application. Can someone point me in the right direction?
(I want to access the API from a Delphi application, if that helps.)
Thanks in advance.

Some time ago I wrote a series of articles about using the Google maps API v3 from Delphi, basically you need a TWebBrowser component and load an HTML page with the JavaScript code to handle the Google Maps JavaScript API v3. from here using functions like IHTMLWindow2.execScript and the MSHTML Interfaces you can interact with the JavaScript code and the Google Maps API responses from Delphi.
Using the Google Maps API V3 from Delphi – Part I Basic functionality
Using the Google Maps API V3 from Delphi – Part II Styled Maps
Using the Google Maps API V3 from Delphi – Part III Getting the latitude and longitude of a mouse click
Using Google maps (Static Maps) without TWebBrowser
Also take a look to these projects
Delphimaps
GMLib – Google Maps Library

If you have serious plans in this direction:
Forget about the Google Maps API, and use OpenLayers instead.
Believe me, I've got hands-on experience with this. I've created countless interactive mapping websites and applications, and I've written code that wrap Google Maps functionality into Delphi components. You can find them on Google code: http://code.google.com/p/delphimaps/
You can also find some example application that I've made with an early version of these components here: Use Googlemap from my Delphi application?
OpenLayers is much more versatile, it's completely open source, and it has a whole community behind it. It can even use Google Maps, but you can easily switch to OpenStreetMaps, Yahoo, Bing, or your own GIS system.
There are many examples online, and you're not tied to stupid rules that are imposed by Google. For example, if you want to use Google Maps via a secure (HTTPS) connection, you have to pay. I never directly use the Google Maps API anymore, and my GIS websites became much better since I started using OpenLayers.
Maybe one day I should wrap OpenLayers into Delphi components, but I now do most stuff in JavaScript instead, and only communicate with my Delphi app when it's really needed, so even with Delphi apps that contain a map, not much GIS stuff is done in Delphi.
That turns out to be easier to maintain.
..
Also, OpenLayers doesn't require any internet connection. It can run 100% in your offline browser. Google Maps requires you to have an internet connection, as it downloads parts of its code dynamically, and it always wants to download its maps from Google.

If you are looking for a complete solution to use the Google Maps API with Delphi, I highly recommend the Delphi Framework for Google Maps. It enables to use all API functions without a single line of HTML or JavaScript.
For example:
procedure TForm1.FormShow(Sender: TObject);
begin
with Script(WebBrowser1) do
if not APILoaded
then LoadAPIAsync(InitMap);
end;
procedure TForm1.InitMap(Sender: TObject);
var
MapOptions: TMapOptions;
begin
with Sender as TScript do
begin
MapOptions:=New(Google.Maps.MapOptions);
with MapOptions do
begin
Zoom:=8;
Center:=New(Google.Maps.LatLng(-34.397,150.644));
MapTypeID:=Google.Maps.MapTypeID.Roadmap;
end;
New(Google.Maps.Map(MapOptions));
end;
end;
The route planner is also easily available. There are some demos.
Unfortunately, you must still download it currently from a German forum. A separate website is under construction. If there are problems with the registration or download, I can send an email with the framework.
Regards

Related

Is it possible to read a Google Spreadsheet from (server-VM-run) Dart code?

I'd like to read data from a Google Drive Spreadsheet in Dart code (running as a console app in the VM, not in the browser). I'm somewhat confused by the names of the API; Sheets is part of Google Drive, but all the Google Drive API docs I can find relate to integrating the UI of Drive into your app.
There's also this question on SO, but it's over 2 years so I'm hoping that it's no longer correct, and there is an API.
I found this Dart Google API library, but it says:
THIS LIBRARY IS DEPRECATED
Please use the Google API Dart libraries in http://pub.dartlang.org, the Dart package manager
Search for 'google' or the API of your choice. For example:
http://pub.dartlang.org/packages/google_drive_v2_api
However I'm struggling to find which package I'm supposed to use. The Drive API one doesn't have a lot of info, and there doesn't appear to be one with "Sheets" or "Docs" in the name.
You need to use the Spreadsheet API https://developers.google.com/google-apps/spreadsheets/.
There isn't a Dart lib for it, but it's a well formed REST API so very easy to program against.
Sheets is not exactly part of Google Drive, it is part of the Google Docs productivity suite that is stored in Google Drive. Google Drive is the general cloud storage layer. The Drive API is for interacting with files of all types that are stored in Drive. You can interact with Sheets files using that API to modify metadata or import or export to/from other formats like csvs. That is possible to do from Dart (I'm not sure if there is a Dart-specific client library, but this API is just rest calls so its always possible.)
If you want to interact with a Sheet at a lower level to do things like modify a single cell, you can use AppScript, however that cannot be done from Dart.
Usually for Google APIs support generators that create access libraries for every language.
For example https://pub.dartlang.org/packages/google_drive_v2_api.
You can generate them yourself (also for your own endpoints) using https://pub.dartlang.org/packages/discovery_api_client_generator but for most APIs there are packages already in pub.dartlang.org.

Using here maps in blackberry

Can i use Here Maps
http://here.com/,
in blackberry RIM version 5.0 and above development?
Because i have an application which gets the user location and i need to put 2 pins on the map and get the distance between them , and the client wants Here maps.
I used bing map lately, but i need here map now.
Bing Maps SDK For Blackberry 6.0
Option 1) Use the Maps API for Java ME with the Blackberry JDK
There is no native Maps API marketed for Blackberry, however the Maps API for Asha is a general Java ME API, whose only dependencies are CLDC1.1 and MIDP2.0, so there is no reason why it shouldn't work with the Blackberry JDE. This article describes the similarities.
There are a series of code examples available which should work out of the box, except for one thing - you'll need to get hold of the jar files which usually reside in
C:/Nokia/Devices/Nokia_Asha_SDK_1_0/plugins/maps api/lib/
which can be obtained from the Nokia Asha SDK.
So all you'll need to do is download the SDK, extract the file maps-core.jar or any of the other packages you want and access them as external JAR dependencies in the usual manner. See the examples on github for an idea of the capabilities of the library.
Option 2) Use the Map Image API with the low level i/o
Now, if all you need is a single "quick and dirty map", you can make a series of http calls to m.nokia.me using javax.microedition.io to get a map on screen. This article explains why using a static map is probably a bad idea, but it would be a simple solution.
Option 3) Create a cross-platform HTML5 app using Cordova or Web Apps
This would be where the Maps API for JavaScript would be useful,
Basically if you would visit the developer.here.com native APIs section, you could see that there is no offering for Blackberry.
Anyway, thus, if you really want to use HERE maps with the platform, you should check out the Javascript API

Getting autocomplete googleMaps data into a Delphi combobox

I am doing a Delphi transport application interacting with GoogleMaps APi and i would like to propose all "near by" names coming from the autocomplete Google Maps API when i enter the starting adress of the direction.
All of this will be displayed in a TCombobox when would be changed on the OnChange propertie.
Is that possible ??? ever heard of it ???
Thanks a lot
Gwenael
There is a part of the Google Maps API called The Google Places Autocomplete API. You can send requests (in the examples part of the reference page there is also the example with bounds for your purpose) as you will type in your combo box (ideally after some short delay for typos corrections). As the result you can receive either JSON or XML format file. After you parse it, you will get the list of appropriate suggestions.
I'm not sure with the Google Maps API Key; if it's possible to use it in standalone application (and about the limitations) because I haven't implemented static part of the Google Maps yet.
My first thought (assuming an approach which is based on remote controlling the web interface) was: this can be solved using TWebBrowser and friends (IWebBrowser2, IHTMLElement etc.). See my answer on this question to get a feeling for this. You could use Embedded Web Browser from bsalsa for easy access to all the Internet Explorer functionality.
My second thought was: there might be a part in the official API for this. But this I don't know. If there is none then the above approach could be a (work-intensive) workaround.
Yes, it's possible.
I have written a free and open source component that implements the Google Place Autocomplete and Google Place Details API's:
https://carbonsoft.co.za/components/
or
https://github.com/RynoCoetzee/TRCGPlaceAutoCompleteCombo

Using Bing Maps REST Services on BlackBerry?

Are there any third party libraries or SDK's - commercial or open source - that would provide a straightforward way to integrate Bing Maps in a BlackBerry application? Now that Bing Maps Mobile is free for use in consumer-facing apps, it's a really compelling choice.
Nutiteq provides the only option I've found so far (short of developing in house). Hoping there are others.
Thanks in advance.
Bing maps has a REST API. You can see this: http://msdn.microsoft.com/en-us/library/ff701722.aspx
However, I am not sure about any SDK for Blackberry. Check if any unofficial project has used this REST API to create a wrapper for Blackberry. Otherwise, you can always use the browser field to fetch the map tiles.

Is there a Delphi implementation of Google Data APIs?

Google offers various libraries for interfacing with the Google Data APIs. Currently these do not include Delphi (Win32) support.
Has anyone done any work on a Delphi interface to Google Data, or the underlying Atom/AtomPub protocols?
There is an open issue with Google suggesting that they create one.
Thanks for your suggestion.
This probably isn't likely to happen anytime in the near future, as we need to
concentrate our available resources in other areas.
However, GData is based upon standard XML and HTTP requests, so work on a Delphi
client library can certainly be done outside Google. I'll leave this issue open so
others can vote for it, and perhaps someone in the community can pick this up.
So you can vote it up.

Resources