GL Maps API Beta Release

Screen01

I've been spending the past few days fleshing out the GL Maps API: my goal is to allow any developer to view, modify, or add content into the map. That's the approach Microsoft and Google have taken with their JavaScript/web clients, but neither of those run particularly well on a phone. And they're not 3D and accelerometer savvy either! So, I'm hoping that other bored engineers at XDA-Developers decide to write their own plug-ins and help make this a great application. :)

So, to foster that, I'm open sourcing the "standard" plug-ins I've written so far:

GL Maps Download.

GL Maps SDK and source code to the standard plug-ins.

Developers wishing to make their own plug-ins can do so pretty easily.

  1. Create a new C# Smart Device Class Library Project (.NET CF 3.5). Name it GLMaps.PlugInName. Your assembly/project name must start with "GLMaps." so that GL Maps knows that it is a plug-in assembly.
  2. Add a reference to GLMapsPlugin.dll (included in the source code download).
  3. Create a public class and implement the following interface:
using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace GLMaps
{
// Summary:
// IGLMapsPlugin defines the Plugin interface used by the GL Maps application.
public interface IGLMapsPlugin : IDisposable
{
// Summary:
// MapObjects contains a list of objects that are to be shown on the map.
BindingList<IGLMapsObject> MapObjects { get; }
//
// Summary:
// Return the Plugin's MenuItem that should be added to the GL Maps application
// menu. If null, this plugin will not have a MenuItem.
MenuItem MenuItem { get; }
//
// Summary:
// Name of the IGLMapsPlugin as it is seen in the list of Plugins in GL Maps.
string Name { get; }
//
// Summary:
// TimerInterval is the interval in milliseconds at which the OnTimer interval
// is called.
int TimerInterval { get; }

// Summary:
// Initialize is the first method called by the IGLMapsPluginHost. When called,
// the plugin should do all it's necessary one time setup.
//
// Parameters:
// host:
void Initialize(IGLMapsPluginHost host);
//
// Summary:
// OnTimer is called by the Plugin host every TimerInterval. If the Plugin needs
// to update data on a heartbeat, it should be done in this method. OnTimer
// is called on the UI thread, so any operations that may take a long period
// of time should take place on a separate thread so as not to hang the UI.
void OnTimer();
}
}


Simple plug-ins should only take 10~20 lines of code!

Note:

This API will change and evolve in the next few weeks as I fill any holes or add new features. Any breaking changes will require a recompilation of existing plug-ins.

9 comments:

Anonymous said...

hi,
i have dev a plugin for glmaps, that use cellID info for location.
That works very nice. I can set the marker. Now i want to zoom automaticly near the location.
How can i do that?

thanks

Koush said...

The Google Geolocation API already does that. :)

But to Zoom automatically near the location, you can set the host's "CurrentLocation" geocode, and then set Zoom to 15.

I'll be updating the API again very soon to add directions and more map navigational features!

Anonymous said...

Hi,
I set the currentlocation with geocode (lat&lo). And then zoom=15.
But i did not zoom to my location.
When i test my lat & lo by PC, there is everything fine.

Koush said...

Ahh, that's probably because the build you have did not have the CurrentLocation property implemented on the plugin host. I'll be releasing a new build of GLMaps shortly to address this, as well as a lot of other new features.

Rory said...

This is amazing. Especially that not long after you release this, google comes out with a version of Google Earth for the iPhone, with - you guessed it - accelerometer support, dragging, etc.

Suspicious, is what I call it! :P

Le Sage said...

Well I installed the Google Gears plugin & GL Maps on my HTC Touch Diamond, but it didn't really work. :-\
On first run it asked for permission to access to Gears possibility (which I gave him), but the maps stays on start mode (showing all world) & won't show anything. The accelerometer's 3D effect works though.
I tried plugged with ActiveSync & not plugged with a working SIM card & 3G Data on.
Is there anything I did wrong ?
Does the fact that I'm in France affect the result ?

Anonymous said...

I've the same problem as le sage.
The app loads and shows the grey surface of the world, and reacts to the accelerometer, but NO MAPS load!
I've also tried with wifi, ActiveSync and HSDPA... nothing.
The previous version worked well.

G said...

Works great in Holland :)
Need to start the app twice on my Diamond though
Great app!

Dejan said...
This comment has been removed by the author.