mirror of
https://github.com/mapgears/ol3-google-maps.git
synced 2026-01-25 16:50:49 +00:00
This patch introduces documentation about the limitations of this library, notably the 'rotation' that should not be enabled, as mentioned in \#4. A new `LIMITATIONS.md` file was added to document this. A new utility method that returns the default interactions that include only the ones that are recommended (well, more like 'exclude' those that aren't).
21 lines
485 B
JavaScript
21 lines
485 B
JavaScript
var center = [-7908084, 6177492];
|
|
|
|
// This dummy layer tells Google Maps to switch to its default map type
|
|
var googleLayer = new olgm.layer.Google();
|
|
|
|
var map = new ol.Map({
|
|
// use OL3-Google-Maps recommended default interactions
|
|
interactions: olgm.interaction.defaults(),
|
|
layers: [
|
|
googleLayer
|
|
],
|
|
target: 'map',
|
|
view: new ol.View({
|
|
center: center,
|
|
zoom: 12
|
|
})
|
|
});
|
|
|
|
var olGM = new olgm.OLGoogleMaps({map: map}); // map is the ol.Map instance
|
|
olGM.activate();
|