How can I use google map with OpenLayers 3?
I want to migrate from OpenLayers 2 to 3.
here is an example:
google map integration with openlayers example
but using this method need to change the old html code (the two element needs, 'gmap' and 'olmap' that mentioned example).
Google Maps is officially not supported by ol3, but my question is:
"How can I use Google Maps Tile Service in my project like a MapServer, that without needing to add google api reference (for optimizing purposes) to scripts tag?"
Here is my old code that works correctly with OpenLayers 2:
var map = new OpenLayers.Map("map_canvas", {
controls: [
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.ScaleLine(),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.OverviewMap()
],
units: "m",
numZoomLevels: 21
});
var gmap = new OpenLayers.Layer.Google(
{ type: google.maps.MapTypeId.ROADMAP, numZoomLevels: 21}
);
map.addLayers([gmap]);
and html code:
<div id="map_canvas">
</div>
appreciate any help