The OL3-Google-Maps library comes with several limitations as both OpenLayers 3 and Google Maps aim towards very different goals. The limitations that are known are listed here. If you come across something not listed here, you may open a new issue on GitHub.
Before jumping into details about each one, note that the sole purpose of this library is to allow developers of web mapping applications to enjoy both OpenLayers 3 and Google Maps libraries together. If either of the two is enough to fit the requirements of the application you want to develop, then it is strongly recommended to just pick one and build it on top of it.
Styling of circle geometries, i.e. ol.geom.Circle
is currently not supported
in OL3-Google-Maps.
Recommendation: avoid using such geometry type.
Clusters are not yet supported as no development towards it has been made yet.
Recommendation: avoid using clusters.
It's possible to assign a custom tile grid to a tile layer. However, the extent for the tile grid should cover the whole map for it to work with the Google Maps API, otherwise it will appear in the top left corner.
Larger square tiles seem to work well, but rectangular tile sizes haven't been tested. Origins other than the top left corner or the center will probably be problematic. Different tile sizes and origins for each zoom level also remains untested.
Recommendation: set the TileGrid's extent to the default extent for that
projection: ol.proj.get('EPSG:3857').getExtent()
When activated, the Google Maps map is placed below the OpenLayers one. Any layers that would normally be in between them in the OpenLayers map will all end up on top of Google Maps layers. Note that layers that are supported (see below) won't be affected by this limitation.
Recommentation: avoid placing layers between the Google Maps ones in your OL3 map and make sure they are always at the bottom too, for simplicity.
The ol.interaction.DragPan
interaction is added by default to the map with
the kinetic
option enabled, allowing the map to be panned using kinetic
effects. While the kinetic animation is in progress, the center of the map
is where the animation will end. This has the downside effect to instantly
panning to the end location if a Google Maps layer is active and visible.
To avoid this, it is not recommended to use the kinetic effects.
Recommendation: use interactions: olgm.interactions.defaults()
in your OL3
map options, in which the interation that does kinetic animation while panning
the map is not included.
The following layers are currently supported by this library, i.e. they are rendered directly in Google Maps for a smooth effect while interacting the map:
ol.layer.Vector
olgm.layer.Google
ol.layer.Image
withol.source.ImageWMS
ol.layer.Tile
withol.source.TileWMS
,ol.source.WMTS
andol.source.XYZ
All the other layers currently stay in OpenLayers, on top of Google Maps.
Recommendation: use only supported layers in your map.
The styling of the following multi-geometries are supported by OL3-Google-Maps:
MultiLineString
MultiPolygon
MultiPoint
OpenLayers 3 supports rotating the map in a 'free' way, i.e. the view of the map can be rotated in any direction, in any angle. Google Maps' API only allows rotating the map in increments of 90 degrees.
There is a workaround implemented to rotate the div containing the Google Maps map, which should be enough for basic rotation support, but it won't be perfectly functional until Google Maps implements a way to rotate the map freely in their API.
Recommendation: use interactions: olgm.interactions.defaults()
in your OL3
map options, in which the interactions that allow rotating the map are not
included.
Style functions as style definition are not supported yet.
Recommendation: use a plain ol.style.Style
object for you style definition.
Style arrays as style definition are not supported yet.
Recommendation: use a plain ol.style.Style
object for you style definition.
Google Maps API uses several layers to render its vector features. They are
known a
MapPanes,
each having a fixed Z order. Polygons and Linestrings are rendered in the
overlayLayer
(Pane 1). Points are rendered in the markerLayer
(Pane 2).
This means that the Z order defined in OpenLayers is not exactly the same in Google Maps.
Vector labels, i.e. text styling definition, are supported but come with several limitations. Before jumping into those, note that OL3-Google-Maps focuses on having the labels on the Z order they are added, i.e. a polygon added after a label should be rendered on top of the text.
Limitations:
- the
rotation
option is currently not supported - in the Google Maps map, the labels are rendered in the
markerLayer
(Pane 2), which makes the Z order of labels not working as expected for polygons and linestring - in Google Maps, markers that use image as source are rendered in tiles, which ignore the Z order defined per feature. This causes the labels to always appear on top of all markers.
- updating a label geometry is slow, which affects the visual smoothness of dragging a feature on the map