Google layer appears wrong with gwt-openlayers -


i use gwt 2.6.1 (with activities , places framework) , gwt-openlayers 1.0

the problem comes when use google layer (google or googlev3 instance) base layer. map appears can't zoom or drag , openlayers controls missing display (zoom buttons, layer switcher, scale line). after hitting f5 (refresh), problems gone , works fine. bing baselayer these problems aren't occurred.

the situation complex can reproduced: need 3 pages.

  • first: welcome page
  • second: can empty. has place token: "secondpage"
  • third: page contains map (#mappage)

you can see welcome page, when open application in browser. type token of second page after url (#secondpage). after second page displayed, type token of third page after base url (#mappage). if follow scenario, mentioned problems come.

the ui.xml of third page:

<gxt:contentpanel headervisible="false" borders="false" bodyborder="false" height="500px" width="500px"/> 

the view of third page:

... @override public widget aswidget() {     this.widget = testview.uibinder.createandbindui(this);     ((contentpanel) testview.this.widget).add(testgoogle.getmap());     return this.widget; } ... 

testgoogle class:

public class testgoogle {      public static mapwidget getmap() {         mapoptions defaultmapoptions = new mapoptions();         defaultmapoptions.setnumzoomlevels(16);          mapwidget mapwidget = new mapwidget("100%", "100%", defaultmapoptions);          googlev3options ghybridoptions = new googlev3options();         ghybridoptions.setisbaselayer(true);         ghybridoptions.settype(googlev3maptype.g_normal_map);         googlev3 ghybrid = new googlev3("google hybrid", ghybridoptions);          map map = mapwidget.getmap();         map.addlayer(ghybrid);          map.addcontrol(new layerswitcher());          map.addcontrol(new overviewmap());          map.addcontrol(new scaleline());           lonlat lonlat = new lonlat(6.95, 50.94);         lonlat.transform(projectioncode.longlat.getepsgcode(), map.getprojection());          map.setcenter(lonlat, 12);          return mapwidget;     } } 

i've found problem. included google maps api script in host page twice.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -