Re: GWT Maps V3 Api, clearing directions

1,075 views
Skip to first unread message

Joseph Lust

unread,
Aug 31, 2012, 11:05:17 AM8/31/12
to google-we...@googlegroups.com
Jonas,

Can you please posit your issue on the GitHub tracker and we'll look into it. :)



Sincerely,
Joseph

Deepak Singh

unread,
Sep 4, 2012, 10:15:51 AM9/4/12
to google-we...@googlegroups.com
I want to use this library.

I have lattitude and longitude with me and i need to show the location on the map.
Also, need to find the nearest locations based on lattitue/longitude.

I went through the docs but could not understand the right class to be used.

Can you give me some sample code ?

Thanks
Deepak

On Fri, Aug 31, 2012 at 6:52 PM, Thai Ha Duong <duong...@gmail.com> wrote:
I have the same question please any one can help?


On Friday, 31 August 2012 12:47:02 UTC+1, Jonas wrote:
I'm using the GWT Maps V3 Api from https://github.com/branflake2267/GWT-Maps-V3-Api

After finding directions on the map, I'm trying to clear the previous ones before finding new.

In DirectionsRenderer:

  /**
   * This method specifies the map on which directions will be rendered. Pass null to remove the directions from the map.
   * @param mapWidget
   */
  public final void setMap(MapWidget mapWidget) {
    setMapImpl(mapWidget.getJso());
  }

  private final native void setMapImpl(MapImpl map) /*-{
    this.setMap(map);
  }-*/;

I'm trying to pass:

directionsDisplay.setMap(null);

which results in NPE:

Caused by: java.lang.NullPointerException: null
    at com.google.gwt.maps.client.services.DirectionsRenderer$.setMap$(DirectionsRenderer.java:50)

Anyone used this API and knows how to clear directions from the map widget?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/emLbrk1GnloJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh

Deepak Singh

unread,
Sep 18, 2012, 8:22:17 AM9/18/12
to google-we...@googlegroups.com


On Tue, Sep 18, 2012 at 12:32 AM, Deepak Singh <deepaks...@gmail.com> wrote:
As far as, I know there has to be a unique for using google maps.

Where would i place my unique key?

I have a limited requirement to find near about places using LatLong, will it be enough to use just Basic map widget class?

Regards
Deepak 


On Wed, Sep 5, 2012 at 12:00 AM, Jonas <sar...@gmail.com> wrote:
Hi Deepak,

Here is a show case of different features from the library: http://gonevertical-apis.appspot.com/
You can find the source code here: https://github.com/branflake2267/GWT-Maps-V3-Api/tree/master/Apis_Maps_Test/src/com/google/gwt/maps/testing/client/maps

Regarding clearing the directions, Brandon has already fixed it.




--
Deepak Singh



--
Deepak Singh

Joseph Lust

unread,
Sep 18, 2012, 9:27:39 AM9/18/12
to google-we...@googlegroups.com
This is the V3 Maps API. The V3 does not use API keys like V2 does. Because you download the JS from Google, and it has to start on your site (where it can detect the URL), they track the API usage that way.

So, you should be able to just use the example in the Showcase (2nd example) to fetch your directions

Sincerely,
Joseph

Brandon Donnelson

unread,
Sep 19, 2012, 1:27:19 AM9/19/12
to google-we...@googlegroups.com
This should be resolved, but if it isn't let me know. :)

Brandon Donnelson

unread,
Sep 19, 2012, 1:30:04 AM9/19/12
to google-we...@googlegroups.com
Are you looking for the PlaceServiceSearchRequest? If so, I added and example map in the live demo maps. 


Brandon

Deepak

To unsubscribe from this group, send email to google-web-toolkit+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh

Deepak Singh

unread,
Sep 19, 2012, 3:32:21 PM9/19/12
to google-we...@googlegroups.com
I added jar file APIs_Google_map3.8.0beta.jar to my classpath.
Added this to lib also.

Included 
<inherits name='com.google.gwt.maps.Apis_Google_Maps' /> to my *.gwt.xml

When i run the app in local, i get the following exception

Unable to find 'com/google/gwt/ajaxloader/AjaxLoader.gwt.xml' on your classpath;

Thanks
Deepak

To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/r8sXg55osSoJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh

Deepak Singh

unread,
Sep 19, 2012, 4:06:12 PM9/19/12
to google-we...@googlegroups.com
Now, I added gwt-ajaxloader.jar
It was able to run in dev mode.

Now i run the following code

MapOptions mo = MapOptions.newInstance();
LatLng ll = LatLng.newInstance(Double.parseDouble(latitude), Double.parseDouble(longitude));
mo.setCenter(ll);
mo.setZoom(4);
mo.setMapTypeId(MapTypeId.HYBRID);
MapWidget mw = new MapWidget(mo);
// enquiryDiv.appendChild(mw.getElement());


com.google.gwt.core.client.JavaScriptException: (TypeError) @com.google.gwt.core.client.impl.Impl::apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)([JavaScript object(6222), JavaScript object(6221), JavaScript object(6296)]): $wnd.google is undefined
--
Deepak Singh

Deepak Singh

unread,
Sep 19, 2012, 4:09:30 PM9/19/12
to google-we...@googlegroups.com
Could not resolve the exception mentioned.

Then i copied PlaceSearchMapWidget.java and tried to use.

But could not create the widget as 
    PlacesService placeService = PlacesService.newInstance(attrContainer, mapWidget);
And i could not understand 'attrContainer' parameter.


My requirement is simple,

I have latitude and longitude. I need to search places within 2 kms area of this latlong.

Pls let me know which kind of class will be useful for me ?

Regards
Deepak
--
Deepak Singh

Deepak Singh

unread,
Sep 20, 2012, 12:54:36 PM9/20/12
to google-we...@googlegroups.com
Any guidance pls..
--
Deepak Singh

Brandon Donnelson

unread,
Nov 28, 2012, 1:08:01 AM11/28/12
to google-we...@googlegroups.com
The library isn't loaded when this shows up. 

Have a good day,
Brandon Donnelson


On Tue, Nov 27, 2012 at 9:24 PM, chris herbert <cherb...@gmail.com> wrote:
did you get the issue with $wnd.google is undefined resolved?
Any guidance pls..

Deepak


Deepak


To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/r8sXg55osSoJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh



--
Deepak Singh



--
Deepak Singh



--
Deepak Singh

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

Brandon Donnelson

unread,
Feb 3, 2013, 2:42:59 AM2/3/13
to google-we...@googlegroups.com
The api will need to be loaded like so:

private void loadMapApi() {
    boolean sensor = true;

    // load all the libs for use in the maps
    ArrayList<LoadLibrary> loadLibraries = new ArrayList<LoadApi.LoadLibrary>();
    loadLibraries.add(LoadLibrary.ADSENSE);
    loadLibraries.add(LoadLibrary.DRAWING);
    loadLibraries.add(LoadLibrary.GEOMETRY);
    loadLibraries.add(LoadLibrary.PANORAMIO);
    loadLibraries.add(LoadLibrary.PLACES);
    loadLibraries.add(LoadLibrary.WEATHER);
    loadLibraries.add(LoadLibrary.VISUALIZATION);

    Runnable onLoad = new Runnable() {
      @Override
      public void run() {
        draw();
      }
    };

    LoadApi.go(onLoad, loadLibraries, sensor);
  }




Have a good day,
Brandon Donnelson


On Sat, Feb 2, 2013 at 12:03 PM, riparrag <rodrig...@gmail.com> wrote:
i've got the same issue:
added gwt-maps-api-3.9.0-build-17.jar
added gwt-ajaxloader.jar

added the <inherits name='com.google.gwt.maps.Maps' /> in my project.gwt.xml 

in this line: LatLng center = LatLng.newInstance(49.496675, -102.65625);

when i debug my web app i get the error: $wnd.google is undefined 

pls help.
Any guidance pls..

--
Deepak Singh



--
Deepak Singh



--
Deepak Singh

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/YC42P9rL5bkJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.

To post to this group, send email to google-we...@googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages