rrogers25
Posts: 31
Joined: Wed Jan 07, 2009 4:49 pm

How do I make Hybrid the Default View

Wed Feb 25, 2009 4:51 pm

Hey guys,

I would like to make the Hybrid map view the default view. Is there a quick fix solution on my end to make this happen?

Thanks,

Robb

User avatar
Fredrik
Posts: 1159
Joined: Fri Mar 02, 2007 1:04 pm
Location: Sweden
Contact: Website

RE: How do I make Hybrid the Default View

Wed Feb 25, 2009 5:24 pm

Hi,
yes, a quick fix can be achieved using a plugin script.
Insert the following code snippet in a "setdefaultgmaptype.js" and put it in the Resources/VehicleTracker/CustomScripts directory of your GpsGate Server installation.

Code: Select all

/**
 * Example GpsGate Server VehicleTracker plugin that allows setting the default Google map type to be display at startup.
 */
(function()
{
    // specify the desired map type here.
    // see http://code.google.com/apis/maps/documentation/reference.html#GMapType.G_HYBRID_MAP for list of map types
    var StartupGMapType = G_HYBRID_MAP;


    /////////////////////////////////////////////////////////////
    Franson.Event.listenOnce(window, 'onload', function()
    {
        if (typeof(vtMain) == 'undefined') // only run when in map-view mode
            return;

        Franson.Event.listenOnce(vtMain, 'onloaded', function()
        {
            log('Plugin: setting default google map type');

            // handle both GGS v2.0.5 and v2.1 interfaces
            var gmap = null;
            if (vtMain.getNativeMap && vtMain.getMapType && vtMain.getMapType() == 'gmap')
            {
                gmap = vtMain.getNativeMap();
            }
            else if (vtMain.getMap && vtMain.getMap().type == 'gmap')
            {
                gmap = vtMain.getMap().getNativeMap();
            }

            if (gmap != null)
                gmap.setMapType(StartupGMapType);
        })
    });

})();
Regards,
Fredrik

Franson Support

GRACO
Posts: 488
Joined: Mon Sep 01, 2008 8:19 am

RE: How do I make Hybrid the Default View

Sat Jun 13, 2009 3:17 am

this script is not working with 2.2...
any idea?
or what do I need to add to gmap_plugin to make it hybrid default?

best regards

alfistico
Posts: 4
Joined: Tue Jun 09, 2009 8:13 pm

RE: How do I make Hybrid the Default View

Tue Jun 16, 2009 9:14 am

Will this script work for making Map24 Default on GGS 2.2?

User avatar
Fredrik
Posts: 1159
Joined: Fri Mar 02, 2007 1:04 pm
Location: Sweden
Contact: Website

RE: How do I make Hybrid the Default View

Tue Jun 16, 2009 1:17 pm

@altfistico
No. But we will probably include the last selected map in the UI-state in a future service release of GGS/VT.

--
After the recent GGS v2.2 release we are preparing updates to several of the earlier plugins. Give us a few days.

Regards,
Fredrik

Franson Support

armin17
Posts: 9
Joined: Mon Nov 23, 2009 12:38 am
Location: Bosnia and Herzegovina

RE: How do I make Hybrid the Default View

Wed Dec 23, 2009 1:08 am

How to make the Hybrid map view the default view in VehicleTracker - 2.3.0.1944
Originally posted by Fredrik

Hi,
yes, a quick fix can be achieved using a plugin script.
Insert the following code snippet in a "setdefaultgmaptype.js" and put it in the Resources/VehicleTracker/CustomScripts directory of your GpsGate Server installation.

Code: Select all

/**
 * Example GpsGate Server VehicleTracker plugin that allows setting the default Google map type to be display at startup.
 */
(function()
{
    // specify the desired map type here.
    // see http://code.google.com/apis/maps/documentation/reference.html#GMapType.G_HYBRID_MAP for list of map types
    var StartupGMapType = G_HYBRID_MAP;


    /////////////////////////////////////////////////////////////
    Franson.Event.listenOnce(window, 'onload', function()
    {
        if (typeof(vtMain) == 'undefined') // only run when in map-view mode
            return;

        Franson.Event.listenOnce(vtMain, 'onloaded', function()
        {
            log('Plugin: setting default google map type');

            // handle both GGS v2.0.5 and v2.1 interfaces
            var gmap = null;
            if (vtMain.getNativeMap && vtMain.getMapType && vtMain.getMapType() == 'gmap')
            {
                gmap = vtMain.getNativeMap();
            }
            else if (vtMain.getMap && vtMain.getMap().type == 'gmap')
            {
                gmap = vtMain.getMap().getNativeMap();
            }

            if (gmap != null)
                gmap.setMapType(StartupGMapType);
        })
    });

})();
Regards,
Fredrik

Franson Support


cicko

jimmywie
Posts: 2
Joined: Fri Jun 08, 2012 3:23 pm
Location: Indonesia
Contact: Website

RE: How do I make Hybrid the Default View

Wed Jun 13, 2012 3:05 pm

How to custom scripts Hybrid Map view in GPSGate Version 3 [?]
i not see this directory on version 3
Resources/VehicleTracker/CustomScripts
on the resources folder only seen
-docs
-Languages
-ScriptPlugins

regards,
Jimmy

User avatar
Fredrik
Posts: 1159
Joined: Fri Mar 02, 2007 1:04 pm
Location: Sweden
Contact: Website

RE: How do I make Hybrid the Default View

Wed Jun 13, 2012 4:40 pm

*The plugin & technique discussed in this thread is long deprecated*.
---
In the current GpsGate Server 3.0 this is handled when saving the workspace.
Login to VehicleTracker, set Google maps to hybrid, goto menu Workspace->Save/Save as.
Next time you open the same workspace, Google maps will be set to hybrid mode.

Regards,
Fredrik Blomqvist

GpsGate Support

jimmywie
Posts: 2
Joined: Fri Jun 08, 2012 3:23 pm
Location: Indonesia
Contact: Website

RE: How do I make Hybrid the Default View

Thu Jun 14, 2012 6:56 am

Great!!!Thank You Fredrik.

regards,
Jimmy

User avatar
juanjogpsgate
GpsGate
Posts: 25
Joined: Wed Oct 08, 2014 12:49 pm
Location: Sweden
Contact: Website

RE: How do I make Hybrid the Default View

Wed Oct 08, 2014 12:54 pm

Just for info, for current version 4, the Hybrid mode as it was called in earlier versions of google maps, you have it enabled by just clicking in Statellite mode, then enabling the Labels option. This will be kept if you log off and log in again, and/or you can also save the workspace for having this as default, later by applying the default workspace to your application, in the application properties.

Return to “GpsGate Server - How to setup and use”