My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 1: Using your Google Map V3 wrapper
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by JOANRIBA...@gmail.com, Feb 23, 2012
Hi
I started to use your library some days ago in my geo-localized blog (www.elmolideponent.com) and it works fine!
I want to comment you the changes that I have done locally:

1. I implemented GwtEvent.getSource() for the map events.
2. I changed the maps version to "3.7" because with version "3" I got a poor performance.
3. I removed 
   impl = MapImpl.newInstance(div, options);
 from MapWidget(...) constructor because some times I had problems with the downloading of the map tiles if the main <div> was not rendered already in the browser.

Thank you very much!
Joan Ribalta

Feb 28, 2012
#1 bouallou...@gmail.com
Hi,
I started to use your library and i have some problems with MapWidget 
when i tried to display several maps in tabItems , the first map is well displayed but the second is not displayed correctelly !

I had attached 2 screen shots to explain more my issue. 

i'll be so gratefull if you can help me to solve this blocking probleme.
Sans titre.png
539 KB   View   Download
Sans titre2.png
89.9 KB   View   Download
Feb 28, 2012
#2 JOANRIBA...@gmail.com
This is because the div where the map is included must be rendered before downloading of the map tiles. You can modify the MagWidget of the library excluding impl = MapImpl.newInstance(div, options); and doing it after the div is already rendered.
Feb 28, 2012
#3 bouallou...@gmail.com
thanks for your quick answer.
but can you give me more details on the modifications you did on the library, i cant find where did you put your new sources.
Feb 28, 2012
#4 JOANRIBA...@gmail.com
Below you have my changes in this case but I didn't analysed the whole wrapper library!. I call MagWidget.go(...) once the MapWidget is rendered...

{
...
  public MapWidget() {
    div = DOM.createDiv();
    setElement(div);
    
    setStyleName("gwt-map-MapWidget-div");
  }
  
  public MapImpl go(MapOptions options)
  {
     impl = MapImpl.newInstance(div, options);      
     return impl;
  }  
...
Feb 28, 2012
Project Member #5 branflak...@gmail.com
Does this happen when you deploy to server? Are you debugging with Chrome or firefox?
Feb 28, 2012
Project Member #6 branflak...@gmail.com
It may be in chrome, and if so there is a bug I need to fix.
Feb 28, 2012
Project Member #7 branflak...@gmail.com
Can you check the javascript console and see if there is a __gwt_Object Id error?
Feb 29, 2012
#8 bouallou...@gmail.com
I debugging with Firefox and I have not error in the console of firebug 
Feb 29, 2012
#9 bouallou...@gmail.com
hello JOAN,
i did all the modifcations you've suggested me to do, i called the method go(..) in the afterrender method, but i had the same result as above.

before using this library, i was using another GWT map JAR (https://code.google.com/p/gwt-google-maps-v3/), and i have a perfect result with displaying several maps on different tabitem, but infortunately it was poor of other fonctionnality that ii need to work with like drawing library ...etc

I had attached a sample project to explain more my issue. 

src.rar
1.9 KB   Download
Feb 29, 2012
#10 JOANRIBA...@gmail.com
Now I'm travelling, so for me it is impossible to check it. 

The important thing is that the div (inside MapWidget) must be totally rendered with its final size before calling the go! I guess that you can put the "go" inside the onSelection handler of the tab panel and then put something like   
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand()
{
   public void execute()
   {
       ...go(..)
   }
});
Mar 2, 2012
#11 baze...@gmail.com
Hi, You dont need to do any modification! Like JOANRIBA said the rendering is the problem, but this u can solve it by calling 
MapHandlerRegistration.trigger(map, MapEventType.RESIZE);
after the div containing the map gets is last size...

Hope this help:)






Mar 2, 2012
#12 baze...@gmail.com
Hi,

I have one question to Joan!

What do you mean by 
"I changed the maps version to "3.7" because with version "3" I got a poor performance".

where do you change this version?

Blaze
Mar 2, 2012
#13 JOANRIBA...@gmail.com
The Google Maps Library has a minor in the version: https://code.google.com/apis/maps/documentation/javascript/basics.html
The wrapper fixes the version to "3" that gets the last version in development
...load(...)
{
 AjaxLoader.loadApi("maps", "3.7", onLoad, settings);
}
Apparently, I get better performance with 3.7, but I only did superficial testes! 


Mar 15, 2012
#14 bouallou...@gmail.com
i'm trying to use google's geocoder service to get an adress of a position defined by latitude and longitude.
but my probleme is that i can't get the "results" object wich contain a list of adresses to manipulate it outside of the "geocode" method

this is my code :

ArrayList<LoadLibrary> loadLibraries = new ArrayList<LoadApi.LoadLibrary>();
loadLibraries.add(LoadLibrary.PLACES);   
	    
Runnable onLoad = new Runnable() {
      public void run() {
        System.err.println("chargement avec success");
        Geocoder o = Geocoder.newInstance();
        GeocoderRequest request = GeocoderRequest.newInstance();
        LatLng location = LatLng.newInstance(37.12639, 3.64056);
	request.setLocation(location);
		        
	o.geocode(request , new GeocoderRequestHandler() {
	public void onCallback(JsArray<GeocoderResult> results, GeocoderStatus status) {
		            if (status == GeocoderStatus.OK) {
		              
		              if (results.length() > 0) {
		            	  for (int i=0; i < results.length(); i++) {
		                      GeocoderResult result = results.get(i);
		                      
		                      JsArray<GeocoderAddressComponent> components = result.getAddress_Components();
		                      int len = components.length();
		                                            
		                      String address = result.getFormatted_Address();
		                      System.err.println("address : "+address);
		            	  }
		              }
		            } else {
		            	System.err.println("Erreur pas d'adresse  : -------------------------");
		            }
		            
		          }
		        });
	      			      
	      }
	    };
	    
	    LoadApi.go(onLoad, loadLibraries, sensor);

please help me to understand more this service

Powered by Google Project Hosting