I'm developing an application using GeoExt 3(Openlayers 3.15.0 and Extjs 6.0.2). I want to use Google map as base layer using ol3 google maps.
I add ol3 google maps
to my project as follow:index.html
:
type="text/javascript">
Now I add google map as follow:
var googleLayer = new olgm.layer.Google();
var map = new ol.Map({
layers: [googleLayer],
view: view
});
For activating google map, I use follow code:
var olGM = new olgm.OLGoogleMaps({map: map}); // map is the ol.Map instance
olGM.activate();
Occur an error as follow:
ol3gm.js:47 Uncaught TypeError: Cannot read property 'removeChild' of null
When I set time out as follow, It don't occur any error:
setTimeout(function(){
var olGM = new olgm.OLGoogleMaps({map: map});
olGM.activate();
}, 2000);
But in this state The map is blurred. See the result:
But the ol3 google maps sample result at here is as follow:
Why my result is blurred? Where is the problem?
update:
All things in Firefox is OK, This result is in Google Chrom 50.0.2661.102
No comments:
Post a Comment