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

Plugin: OpenLayers Maps

Tue Jul 21, 2009 10:51 pm

OpenLayers Map support for VehicleTracker
GpsGate Server 3.0

This plugin enables the usage of OpenLayers/OpenStreetMap maps in VehicleTracker.

OpenLayers is an Open Source mapping client that has many extensions to enable integration with different map providers, GIS, WMS/WFS services, shapefiles, Tiger data etc.
Please see http://openlayers.org for more information.

Steps to install

0. Download the plugin from the GpsGate Server plugin repository, update.gpsgate.com.
You do this from SiteAdmin->Plugins and select Download New Plugins. Search for "OpenLayers" and click Download.

1. Go to SiteAdmin->Applications and enable the plugin for the application(s) of your choice. You do that in Privileges and Roles->Enable/Disable Features, then select Maps->_UseMapPlugin->OpenLayers.

2. Login to the VehicleTracker application. Go to Admin->Features and enable OpenLayers for the user(s) of your choice. You do that in Role Privileges->Maps->_UseMapPlugin->OpenLayers.


Next time you login to VehicleTracker you should see "OpenLayers" show up in the "Maps" menu.

Updates
http://forum.gpsgate.com/topic.asp?TOPIC_ID=14186

Regards,
Fredrik Blomqvist

Franson Support

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

RE: Plugin: OpenLayers Maps

Fri Jul 24, 2009 8:00 pm

Update
- Fixes a map resize and potential marker "sliding" problem for the Bing maps.

To upgrade:
1. Download the OpenLayers.zip file from the initial link above.
1. Replace your existing files.
2. Login to SiteAdmin/ScriptPlugins (as above) and press "Refresh Script Plugins".

Regards,
Fredrik Blomqvist

Franson Support

lolacha14
Posts: 6
Joined: Tue Jul 28, 2009 5:10 pm

RE: Plugin: OpenLayers Maps

Mon Aug 03, 2009 9:55 am

where I can find OpenLayers map for IGN (Institut géographique national)

on

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

RE: Plugin: OpenLayers Maps

Tue Aug 18, 2009 2:02 pm

@lolacha14
I answered you question here: http://franson.com/forum/topic.asp?TOPIC_ID=10288

Regards,
Fredrik

Franson Support

petzlux
Posts: 1
Joined: Sun Sep 27, 2009 5:54 pm

RE: Plugin: OpenLayers Maps

Sun Sep 27, 2009 6:20 pm

Hi

I am trying to use custom generated tiles for a basemap using the OpenLayers Plugin. I run into a significant problem. My tiles are generated using the common tile naming specification, ie XYZ. One example are the OpenStreetMap tilesets.

Problem is that the tiles need the map to be instantiated as using the SphericalMercator projection. I can set this in the openlayers map configuration, but then vehicle positions are all centered around 0,0 . I believe this is because Franson passes LonLat values to OpenLayers, and there is no coordinate transform happening to reproject lonlat values to spherical mercator!

Is that correct, and can you provide me with a openlayers.js that makes the usage of projected tile layers possible?

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

RE: Plugin: OpenLayers Maps

Mon Sep 28, 2009 9:19 pm

The GGS map (and applications) expect WGS84 LonLats in all interfaces. Creating a custom projection map plugin is, in principle, simply making sure you convert to/from WGS84 in both the projection object (fromContainerPixelToLatLng and fromLatLngToContainerPixel) and in the public map methods (getCenter, setCenter, getBounds etc).

A similar case which we solved was recently opened here: http://franson.com/forum/topic.asp?TOPIC_ID=10552. Based on this I'm currently working on a guide to cover custom OpenLayers projection and will hopefully post it here shortly.
If you have more information about your map case (i.e current state of your plugin code) please post it to support-at-gpsgate.com and we could take a look.


Regards,
Fredrik

Franson Support

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

RE: Plugin: OpenLayers Maps

Wed Sep 30, 2009 10:34 pm

An OpenLayers plugin supporting Spherical Mercator and other custom projections is now posted here: http://franson.com/forum/topic.asp?TOPIC_ID=10648
Please try it out and see if it fits your needs.

Regards,
Fredrik

Franson Support

Nome
Posts: 195
Joined: Sun Jul 25, 2010 7:23 am

RE: Plugin: OpenLayers Maps

Sat Oct 02, 2010 1:53 am

Hi people,

This is my modified plugin which includes overlays layers which you can turn off and on through a tick box.

Right now i am working to get openlayers to work on the local environment without having to get the OpenLayer.js from the Openlayer site. In other words.I am trying to get this plugin working without having to be online. If any one can help it would be great. This is important for us here in the Pacific with limited internet connectivity and expensive ISP. For our customer service staff who will be using the dispatch plugin. They will not have access to internet so getting it work without the internet is important to us. However if you have internet access. This will work without any problem. Thanks again Fredrik for the help.

These are just the parts i changed

Code: Select all

   var mapoptions = {
      controls: [
         new OpenLayers.Control.Navigation(),
         new OpenLayers.Control.PanZoomBar(),
         new OpenLayers.Control.LayerSwitcher(),
         new OpenLayers.Control.ScaleLine(),
         new OpenLayers.Control.MousePosition(),
         new OpenLayers.Control.OverviewMap(),
         new OpenLayers.Control.KeyboardDefaults(),
         new OpenLayers.Control.ZoomBox()
      ],

      maxExtent: bounds,
  /* TODO: change this value to get a different max resolution. */
      maxResolution: 0.0008041964042479,
      projection: "EPSG:4326",
      units: 'degrees'
   };

   var map = new OpenLayers.Map(divId, mapoptions);
   



   //----------------------Base Layers[Default] (PlaceName,Road,Coastlie)------------------------

   var format = 'image/png';

   var Base = new OpenLayers.Layer.WMS(
      "Base Layers",
      this._options.wmsUrl,
      {
      /* Insert your "Layer-group Name" here */
         layers: 'Base_Layers',
         styles: '',
         srs: 'EPSG:4326',
         format: format,
         tile: 'True',
      },
      {buffer: 0}
   );

   map.addLayer(Base);
   
   // ToDo: Set a default starting position here:
   map.setCenter(new OpenLayers.LonLat(12.52678, -70.01336), 4);

   this._map = map;

   //----------------------------------------------------------



   //------Fault Service View (Meters,Poles + Base_Layers)--------------------------------------

   var format = 'image/png';

   var Fault = new OpenLayers.Layer.WMS(
      "Fault Service View",
      this._options.wmsUrl,
      {
      /* Insert your "Layer-group Name" here */
         layers: 'Fault_View',
         styles: '',
         srs: 'EPSG:4326',
         format: format,
         tile: 'true',
      },
      {buffer: 0}
   );

   map.addLayer(Fault);
   

   // ToDo: Set a default starting position here:
   map.setCenter(new OpenLayers.LonLat(12.52678, -70.01336), 4);

   this._map = map;

   //----------------------------------------------------------



   //----------------------PL----------------------------------

   var format = 'image/png';

   var PL = new OpenLayers.Layer.WMS(
      "PL",
      this._options.wmsUrl,
      {
      /* Insert your "Layer-group Name" here */
         layers: 'PL_point',
         styles: '',
         srs: 'EPSG:4326',
         format: format,
         transparent: 'True',
      },
      {buffer: 0}
   );

   map.addLayer(PL);
   
   // ToDo: Set a default starting position here:
   map.setCenter(new OpenLayers.LonLat(12.52678, -70.01336), 4);

   this._map = map;

   //----------------------------------------------------------




   //----------------------MT----------------------------------

   var format = 'image/png';

   var MT = new OpenLayers.Layer.WMS(
      "MT",
      this._options.wmsUrl,
      {
      /* Insert your "Layer-group Name" here */
         layers: 'MT_point',
         styles: '',
         srs: 'EPSG:4326',
         format: format,
         transparent: 'True',
      },
      {buffer: 0}
   );

   map.addLayer(MT);
   
   //map.zoomToExtent(bounds);
   // ToDo: Set a default starting position here:
   map.setCenter(new OpenLayers.LonLat(12.52678, -70.01336), 4);

   this._map = map;

   //----------------------------------------------------------


   //----------------------TX----------------------------------

   var format = 'image/png';

   var TX = new OpenLayers.Layer.WMS(
      "TX",
      this._options.wmsUrl,
      {
      /* Insert your "Layer-group Name" here */
         layers: 'TX_point',
         styles: '',
         srs: 'EPSG:4326',
         format: format,
         transparent: 'True',
      },
      {buffer: 0}
   );

   map.addLayer(TX);
   
   //map.zoomToExtent(bounds);
   // ToDo: Set a default starting position here:
   map.setCenter(new OpenLayers.LonLat(12.52678, -70.01336), 4);

   this._map = map;

   //----------------------------------------------------------

   //set default to no view with only the base layer on by default.
   TX.setVisibility(false);
   MT.setVisibility(false);
   PL.setVisibility(false);
   Fault.setVisibility(false);

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

RE: Plugin: OpenLayers Maps

Mon Oct 04, 2010 9:36 pm

Getting the plugin to use a local OpenLayers should be relatively straightforward, you need to give more details about what goes wrong. Did you 1. do a siteadmin->script plugins->refresh for your plugin? and 2. verify that the local url to OpenLayers is actually valid (use Firebug for example).

minor note: you don't need to repeat the "map.setCenter(..)" and "this._map = map" for each layer, just do it once.

Regards,
Fredrik

Franson Support

Nome
Posts: 195
Joined: Sun Jul 25, 2010 7:23 am

RE: Plugin: OpenLayers Maps

Fri Oct 08, 2010 7:38 am

Hi Friedirk,

Yes it's working now. The problem was actually access privilages. I set the folder which has the Geoserver plugin folder to access by everyone. The client couldn't reach the OpenLayers.js until i allowed access by anyone.

Everything was in order with the placement of the downloaded openlayers folders and edit of the URL of the xml but i realised later that users weren't able to access the JS file.

The other issue was the version of I.E i was using. After installing the latest firefox everything worked to spec.

Anyways, thanks much. At least its working now.

Nome

polonus
Posts: 2
Joined: Fri Dec 14, 2007 3:10 pm
Location: USA
Contact: Website

RE: Plugin: OpenLayers Maps

Fri Nov 12, 2010 5:50 am

I'm not sure if this is the right place to ask, but I don't know where... Is it possible to modify map so it will include life traffic and weather? How about drawing my route? (Similar to map at maps.google.com?)

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

RE: Plugin: OpenLayers Maps

Fri Nov 12, 2010 10:14 pm

Update

- Fixes problems with Internet Explorer.
- Improved projection handling, should now be able to use it with map layers regardless of projection.
- OpenStreetMap layers enabled by default.
- Fixes occasional delayed visibility update in MS Bing Layer.


To upgrade:
1. Download the OpenLayers.zip file from the initial link above.
1. Replace your existing files.
2. Login to SiteAdmin/ScriptPlugins (as above) and press "Refresh Script Plugins".


Regards,
Fredrik Blomqvist

Franson Support

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

RE: Plugin: OpenLayers Maps

Fri Nov 12, 2010 10:25 pm

@polonus
Well, if you know about, and have access to, a web-service that provides map adapted weather or traffic information then you might be able to add it. It all depends on which technology is used etc. If you have more detailed information about such layers please post it and we can take a look.

Regards,
Fredrik

Franson Support

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

RE: Plugin: OpenLayers Maps

Tue Feb 28, 2012 7:13 pm

Info about updates and bufixes to the plugin can now be found here:
http://forum.gpsgate.com/topic.asp?TOPIC_ID=14186

Regards,
Fredrik Blomqvist

GpsGate Support

tremmert
Posts: 5
Joined: Wed Mar 04, 2015 1:51 am
Location: USA

RE: Plugin: OpenLayers Maps

Wed Mar 04, 2015 2:01 am

I am also interested in the weather overlay. I found a plugin that allows weather/traffic overlay if you are using google maps, but nothing related to OpenStreet.

I also found a couple websites on the net that are using openstreet maps and have weather available.

Anyone have any thoughts on how to "transfer" the plugin for google maps to openstreetmaps for weather over lay?

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