Using ol3-google-maps with Openlayers 4

851 views Asked by At

I have tried to use ol3-google-maps with Openlayers v4.6.5 by changing the example from http://mapgears.github.io/ol3-google-maps/ to import the script source for this version in the page, but nothing is displayed and no errors are logged to the console. It seems that maybe ol3gm.js already includes the OLv3 code. Is OLv4 not supported at all? Why? Are there any plans to support it the future or some workarounds I could try?

Thanks, Joao

1

There are 1 answers

2
Alexandre Dubé On BEST ANSWER

ol3-google-maps already includes OpenLayers, as explained in the README, under the Quick start section:

... load the OL3-Google-Maps script included in the tarball of the version you downloaded, which already includes OpenLayers so you don't need to load OpenLayers too

So, you don't need to load it again.

The version of OpenLayers included depends on the version of ol3-google-maps. To know what OL version is used, please see the ol3-google-maps releases.