Working on OpenLayers 3.x

Pol's picture

Hi all,

After a couple of quiet months, I would like to start working actively again with Openlayers.

My goals are:

Things to be done in OL 3.x

  • Strong map data validation and errors management: Not yet done
  • Improve openlayers_services and use JS instead of iframe. Not yet done

Things done in OL 3.x

  • People contributing ! Currently: 4 Want to join ?
  • Use render arrays: DONE
  • Use 'openlayers' element in forms (for input and output): DONE
  • Better split between CTools plugins and CTools exportables: DONE
  • Restore behaviors for things like ol.Graticule etc etc DONE
  • Handle source attributions DONE
  • Use PSR-4 class naming. DONE
  • Geofield integration. DONE
  • Create openlayers_spin submodule to display a spin before displaying the map. See Spin.js. DONE
  • Use views_geojson for Views(vector) based layers: DONE

Current contrib dependencies

The source code has been published the 12 Septembre, 9 days after initial development and its available through git, checkout branch 7.x-3.x or use Github.
Github is the best way for collaborating. Prefer it to the standard Drupal issue queue.

Want to talk about it, chat on IRC: #drupal-geo on freenode!

UPDATE 23: 31/12/2015: First stable release \o/
UPDATE 22: 10/06/2015: Parc asterix is using Openlayers through the Drupal module !
UPDATE 21: 10/06/2015: You can now contribute to Openlayers on Github. Create a branch, a pull a request, review and it's done ! This is the best way to collaborate on a project.
UPDATE 20: 14/01/2015: http://www.basel.com is the first site to use Openlayers 3.x module ! Congrats @das-peter..
UPDATE 19: 14/01/2015: Renamming the branch 7.x-3.1.x to 7.x-3.x for more consistency.
UPDATE 18: 06/01/2015: Documentation has started, thanks @robertwb.
UPDATE 17: 31/12/2014: User Chriscalip is giving a help hand in the Sandbox Leaflet module.
UPDATE 16: 31/12/2014: First external contribution ! Thanks !
UPDATE 15: 29/12/2014: Demo site for Leaflet online.
UPDATE 14: 27/12/2014: First shot at rewriting the Leaflet module using the same codebase as Openlayers.
UPDATE 13: 08/12/2014: Demo site updated.
UPDATE 12: 13/11/2014: das-peter joined the force and is now maintainer! See it's first commit !
UPDATE 11: 10/11/2014: JS hooks and JS Console output update.
UPDATE 10: 05/11/2014: Updates and new features
UPDATE 9: 15/10/2014: Demo site online.
UPDATE 8: 25/09/2014: Bug when displaying layer, see on GitHub too
UPDATE 7: 19/09/2014: Admin UI, components & JS cache: work in progress
UPDATE 6: 12/09/2014: Source are published !
UPDATE 5: 10/09/2014: Set center of a map using another map, contextual links and hook_requirements.
UPDATE 4: 10/09/2014: Cloning, creating, previewing and displaying maps
UPDATE 3: 09/09/2014: Interactions, map preview and first map working \o/
UPDATE 2: 08/09/2014: Video of the UI and workflows and how data get processed.
UPDATE 1: 04/09/2014: First video of the UI and workflows

Comments

Welcome back!

RdeBoer's picture

Hi Pol,
This is great news!
The more maps, the better I say.
Like you recently, I don't have the bandwidth to help out much right now. But I'll be following developments closely.
Welcome back!
Rik

Trouble installing open layer

kagongo's picture

Hi Pol and all,

I have installed this version of open layer on drupal 7.39 as instructed here
https://groups.drupal.org/node/440733

  1. openlayers-7.x-3.0-beta3.tar
  2. I don't have drush on the box
  3. am getting this status report

Openlayers library was not found. To install it, download it manually or use drush dl-openlayers. The library directory must be named openlayers3 to be recognized by this module.

  1. my open layer currently is located here

sites/all/modules/openlayer3
5. when i shift this in
sites/all/libraries/openlayer3
5. Installed drupal doesnt link to this openlayer

Would be eagerly waiting you input on this

Kind Request
Simon

Hi, You shouldn't rename the

Pol's picture

Hi,

You shouldn't rename the module directory.

The module is usually installed in sites/all/modules/openlayers and the library in sites/all/libraries/openlayers3

If you don't want to install the library, you can also use the module Libraries CDN API, and you'll be able to use a CDN version of the Openlayers library without downloading anything.

Please, use the issue queue next time.

Good luck.

-Pol-

installation of Libraries CDN API

kagongo's picture

Hello Pol,

i have decide to make a fresh installation so that i can just use the suggested module Libraries CDN API
.
1. After i have installed drupal
2. installed Libraries CDN API = see this
-------------------------------------------------

Provides a unified API to connect to a CDN like CDNJS or jsDelivr.
Version: 7.x-1.7
Requires: Registry Autoload (enabled), Service Container (enabled), Chaos tools (enabled), Symfony's Services Container (enabled), Services Container Annotation Discovery (enabled)
------------------------------------------------------

3. When i switch to the installed openlayer it doesnt see this module libraries. see the result below

---------------------------------------------------------
Openlayers base API module
Version: 7.x-3.0-beta3
Requires: Libraries (missing), File (enabled), Field (enabled), Field SQL storage (enabled), Image (enabled), Service Container (enabled), Chaos tools (enabled), Registry Autoload (enabled), Symfony's Services Container (enabled), Services Container Annotation Discovery (enabled), jQuery Update (enabled)
Required by: OpenLayers Block (disabled), OpenLayers Block Switcher (disabled), OpenLayers UI (disabled), OpenLayers Contextual Links (disabled), OpenLayers Geofield (disabled), OpenLayers Examples (disabled), OpenLayers Views (disabled)
---------------------------------------------

Why should this happen.
Would be eager to hear from you
Kind Request Simon

development version of open layer

kagongo's picture

who could be having a development version of open layer that i can use for this installation

check your libraries folder

ceaucari's picture

check your libraries folder name, is not openlayer3 but openlayers3 you may be missing the "s"

openlayers3 corrected

kagongo's picture

Hi Ceaucari ,

Thank you for this point out.I have rectified this problem.
I think there is something that am not comfortable with that file structure.
My Libraries can not still connect with open layers.

Initially i was advised by Mr pol that the structure should be as follow

The open layer module is usually installed in sites/all/modules/openlayers and the library in sites/all/libraries/openlayers3

for my case now i can see the following after the auto-installation
for open layer i can locate it here
/public_html/sites/all/modules/openlayers3
the libraries are located here

/public_html/sites/all/modules/libraries_cdn

note that this library can not connect to open layer on the administration / module as you can see below on the open layer

Openlayers base API module
Version: 7.x-3.0-beta3
Requires: Libraries (missing), File (enabled), Field (enabled), Field SQL storage (enabled), Image (enabled), Service Container (enabled), Chaos tools (enabled), Registry Autoload (enabled), Symfony's Services Container (enabled), Services Container Annotation Discovery (enabled), jQuery Update (enabled)

Required by: OpenLayers Block (disabled), OpenLayers Block Switcher (disabled), OpenLayers UI (disabled), OpenLayers Contextual Links (disabled), OpenLayers Geofield (disabled), OpenLayers Examples (disabled), OpenLayers Views (disabled)

where am i going wrong ?

Kind Request
Simon

library works with open layer now

kagongo's picture

Hi,

Some how it works now after an installation of this module "libraries" called (libraries-7.x-2.2.tar)

but have also replace the version of open layer from openlayers-7.x-3.0-beta3.tar to this openlayers-7.x-2.x-dev.tar

They seem to see each other both the libraries and open layer

I would like to see what other people have done with this openlayer for drupal.

Kind request
Simon

ann noticed on open layer

kagongo's picture

Hello all,

When i login to administrator then click structure and finally open layers
1. click map tap

i have realized there is an error as shown below


Notice: Undefined index: projection in openlayers_views_openlayers_layers() (line 128 of /home/webmappi/public_html/sites/all/modules/openlayers3/modules/openlayers_views/openlayers_views.module).

how can i rectify the above error

Kind Request
Simon

For the second time, could

Pol's picture

For the second time, could you please use the issue queue ?

Thanks.

-Pol-

Here's a video of the user

Pol's picture

Here's a video of the user interface in the administration...

It's a WIP, a lot of things needs to be done.

https://www.youtube.com/watch?v=3WjhYmFtiIM

-Pol-

OpenLayers 3 in Drupal 7

celdia's picture

hello Pol
I try to meet you at Drupal Camp Montpellier in May 2014. But I was informed that you were not there.
The OL3 version is it available on Drupal 7? I tried to install the Openlayers module, but I still have version 2.13. Is there a source where you must point to install the OL3 library?

Thank you

Hello, You can only download

Pol's picture

Hello,

You can only download it through git for the moment.
I hope to provide an alpha release in one or two months.

Thanks.

-Pol-

Thank you for this module

AdamMMA's picture

Hi Pol,

Just wanted to say thanks for your continued work on this module. I will be looking to use the module with the OL3 library on my website asap so let me know if you require anybody to test.

Cheers,

Adam

Thanks Adam,Actually I'm

Pol's picture

Thanks Adam,

Actually I'm looking for people to test and give me ideas to improve the module.
I've setup a test site to try and show off new features.

Right now, I'm a bit stuck with this bug, I hope to find a solution soon, you may start there if you want to help, it's greatly appreciated.

Cheers!

-Pol-

Hello I'm interested in work

pineiden's picture

Hello
I'm interested in work iwth openlayers and a lot of geo things.
I can try and give you some help.
On this weekends
Regards ;)

F:+56 9 82142267


Pensamos el mundo que soñamos
Creemos en lo que pensamos
Hacemos lo que creemos
Vivimos en el mundo que construimos.

----------------EL Jerbo Pigmeo--------------

Excellent, can't wait to tame

Pol's picture

Excellent, can't wait to tame the thing :)

-Pol-

Played something with the new

catopuma's picture

Played something with the new module and it works but if i remove a map i need to reinstall the module like special chars issue. What not have yet done is the Views GeoJSON feature. With old OpenLayers 2 it worked fine but with 3.1.x latest release i see no overlay data.

I like the new UI it looks very slick and more flexible than OpenLayers 2.x module. I hope you keep the module slick.

I will check later if the module is compatible to the OpenLayers Mapfish Print https://www.drupal.org/project/openlayers_print module.

Then i receive an Ajax Error if i want choose the for Geofield a Display Widget.

Thank you for you work. I

catopuma's picture

Thank you for you work. I will help testing.

PostGIS module

ilpise's picture

Hello,
I've tried to get the PostGIS module working with the OpenLayers3 module.

Editing the postgis.field.widget.inc file is quite easy to obtain the possibility to select the map to use and obtain the OpenLayers widget to show the map when inserting a content type with a PostGIS field.

When I try to add the Draw interaction to the map from the OpenLayers 3 module the map is not shown (no error in Javascript console and apache).

Is actually this interaction working?
Thanks.

There's still a lot of work

Pol's picture

There's still a lot of work to be done and I don't think that widget and stuff are yet working.

-Pol-

OpenLayers Examples module

ilpise's picture

You have to set the Services module like a dependency for OpenLayers Examples module.

If you enable OpenLayers Examples without Services you got apache error

PHP Fatal error:  Call to undefined function services_endpoint_load_all()

Thanks ! I just fixed it:

Very minor typo, but the date

AdamMMA's picture

Very minor typo, but the date is wrong on update 18 above :)

duplicate post

AdamMMA's picture

duplicate post

Fixed, thanks !

Pol's picture

Fixed, thanks !

-Pol-

Hi, I`ve noticed following

RealGecko's picture

Hi, I`ve noticed following comment in olmap.js and views.js

  // Todo: Find why these following options makes problems
  //minZoom: options.view.minZoom,
  //maxZoom: options.view.maxZoom,

Can you, please, explain what kind of problems do this options make?
Maybe I`ll look into fixing it.

I have a question about

formatC'vt's picture

I have a question about "Things to be done in OL 3.x" they are have a issues with details?

No, no meta issue has been

Pol's picture

No, no meta issue has been created yet.

-Pol-

Do you think it would be

milos.kroulik's picture

Do you think it would be desirable? I've seen some people, who are clearly beleiving, that 3.x is already usable in production.

Why not then !

Pol's picture

Why not then !

-Pol-

Hi, i am using it on a

AndyLicht's picture

Hi,
i am using it on a testsystem, but i think it is stable enough for a productive system.

OL 3 is the recommended version

ifrik's picture

Openlayers-7.x-3.0-beta 1 is set as the recommended version, so anybody who uses drush is getting that version by default.

So obviously people will think that it's ready for production. Why else would have somebody swapped the recommended version from 2 to 3?

Having said that, the fact that there is no documentation at all for 3, while configuration is clearly different then in 2, makes it rather unusable for site builders at the moment.

I'm happy to work on some documentation if somebody can explain the differences. e

Site builder and Documentation WG member

Hello ifrik, You're right.

Pol's picture

Hello ifrik,

You're right. There is no documentation yet and 3.x is the default version because it is ready for production. There are still some bugs, but it's better than 2.x.

Try the module and let me know what you think.

-Pol-

Hi, i will create a video

AndyLicht's picture

Hi,
i will create a video tutorial in the next 4hours, the first time only in german and the second one also in english.
beste regards
Andy

Thanks !!

Pol's picture

Thanks !!

-Pol-

Today, it will be online.

AndyLicht's picture

Today, it will be online.

Hi, here is the link,

AndyLicht's picture

Hi, here is the link, tomorrow i will post a tutorial for a small customized map.

https://www.youtube.com/watch?v=SaOvVoxXG8I

I try to create a view based

formatC'vt's picture

I try to create a view based on nodes with geofield but map is empty. This is because "Use views_geojson for Views(vector) based layers" not implemented or because i do something wrong?

I've put together a tutorial

pwhite's picture

I've put together a tutorial of using the location module, views & Openlayers, its not particulary straight forward if you are coming from Openlayer 2x so hopefully someone will find it useful.

http://bit.ly/1DZphkG

thanks!

formatC'vt's picture

thanks!

Ready for mobile?

RdeBoer's picture

Hi Pol and all,

How do you rate the performance of the latest OpenLayers on mobile?

How much/little javascript and other files are downloaded and is it nice and snappy to use?

How does it compare to Google, Leaflet?

Very interested in hearing from anyone with any experience in this, whether subjective or objective (e.g. A/B test results)

Rik

Never Could Get To Work :(

planettucker's picture

After many cycles of installing and reinstalling I finally got all the jQuery versions and modules lined up to actually USE the OL3 interface. However after weeks of trying, following videos and tutorial posts and whether using data layers or GeoJSN feeds I have yet to create 1 useful map. Every resource that is available to review that actually works is for OL2 and anything I did find on OL3 was essentially steps to 'trick' it into working, or the videos are not English. I've also seen some instances where tutorials get it to work but by using blocks, which I refuse to use. I'd rather use Panels and Content Panes.

Major kudos for those who give their efforts to this project, but for anyone else looking into this - as of this post - I find OL3 to be an incredibly heavy module that is effectively useless at the moment costing weeks of real time to determine.

I'm eager to see how this project evolves and want to adopt it, but if it helps anyone, I found an acceptable solution for my applications with this module https://www.drupal.org/project/ip_geoloc. Super simple, way less overhead and more importantly it just works! No, it doesn't do the switching of layers, but then again for me at least, neither did OL3 :|

IPGV&M

RdeBoer's picture

Gee thanks, planettucker!

Rik
maintainer of IPGV&M (ip_geoloc)

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week