Monday 18 June 2018

openlayers - Why ol3 google maps is blurred?


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:








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 enter image description here



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:


enter image description here


But the ol3 google maps sample result at here is as follow: enter image description here


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

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...