Google Maps for Vaadin 7

Hi Tapio,

Two questions:

  1. Is it possible to draw a heat map simulating a meteorology information? Example: http://www.ec.gc.ca/meteo-weather/C0D9B3D8-D256-407D-A68F-C606D703105E/X-20130131132801908.jpg

  2. If I need to implement this feature by myself, how hard would that be and what should I use?

Heat maps aren’t currently supported but adding them should be easy. Just create a new layer type (GoogleMapHeatmapLayer) and use it like KML layers are used currently. Api reference available
here
.

thank you sir!

Hi,

I would like to ask the community 2 new features.

  1. When you place a icon on the marker, its anchor location is normally on the bottom. It would be nice to anchor it on its center. It sounds silly, but is actually a very important feature. Similar question is here:
    http://stackoverflow.com/questions/12105122/google-maps-api-offset-for-marker-image-replace-marker-not-at-geoposition

  2. Insert a caption on a line. For example:
    https://lh4.googleusercontent.com/kjEJTolAILiS7L6RbTzrcmwwhBE9nhVdrB4FCBU63nz3eUE5WqA-X26JU8lfw7cVqOS4xpuhmz-b6Au9ZomM1XuAvvdYOp3Il237zbnUIK4l4qdZ4wM

I will download the source code and try to implement myself. Since I am new to Vaadin, shouldn’t be a easy task :frowning:

Hello,

I was wondering what would be best approach to add support for WMS layers (I know kml are supported but unfortunately can’t get thosei n kml format). Example in javascript could be found at http://www.gisdoctor.com/v3/wms_single_complete.html . Is there a way to get a hold of google maps object and add those via javascript in Vaadin?

Thank you for reply,

Milan.

I’ll add those to the features as enchancement requests to the
issue list
. I’ll take a look on those as soon as I have time but if you’ll be able to take a look and implement those before, it would be really great if you would contribute to the project and add them as a pull request. Then also I could take a look on those and probably fix/comment if there’s something implemented in a weird way.

You should be able to create a native method either directly to the widget or to the connector

public native void doWMS(MapWidget map) /*-{ //apply here your native JS stuff to the widget, just use variable map }-*/; If I ever get the extension system ready, I’ll also create an example about JavaScript extensions.

Hi Tapio,

I would like to thank you for the amazing add-on, I’ve been using it a lot and it it is really helpful. Also, I was wondering if there’s support for mark clusterers, or if it is planned for the future. It would be a really useful feature.

Thank you,
Jorge

Any feature can be added if it’s simple enough, it’s just that I can’t give any promises since I have no idea when I’ll have time to develope the add-on any further.

Anyway, please make an enhancement request to the
issue tracker
. If you also add links to the APIs or any other implementation details to the ticket I can promise you that I’ll most likely will take a look on that feature when I have time :slight_smile:

Request submitted, thank you! :slight_smile:

I got nullexceptionerror while compiling widgetset. See the attachment. Appreciate for your help.

16437.txt (17.5 KB)

I am getting a similar problem and here are the details…

Got eclipse 4.4 and the latest Vaadin plugin. downloaded and added the googlemaps-0.9.0.jar to my project WEB-INF/lib directory and hit ‘compile plugin’ button but getting the following track trace…

can anyone help me please?

Starting GWT compiler
Loading inherited module ‘org.strathfield.tamil.terry.widgetset.TerryWidgetset’
Loading inherited module ‘com.vaadin.tapio.googlemaps.Widgetset’
[ERROR]
Line 3: Unexpected exception while processing element ‘inherits’
java.lang.NullPointerException
at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:324)
at com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.__inherits_begin(ModuleDefSchema.java:502)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
.
.
.
.

If you’re not using automatic dependency management (as it seems), have you copied manually the GWT API jar to your project? From the infos of the add-on:

If you want to use the add-on without Maven (or Ivy), grab If you want to use the add-on without Maven/Ivy, grab GWT-Maps-V3-Api from https://github.com/branflake2267/GWT-Maps-V3-Api.

:slight_smile: how do i use(setup) dependency management in eclipse?

nice one Tapio! all working now, thanks very much.

added the folowing to ivy.xml

    <dependency org="com.vaadin" name="vaadin-client-compiler"
        rev="&vaadin.version;" conf="widgetset-compile->default" />
    <dependency org="com.vaadin.tapio" name="googlemaps" rev="0.9.0" />
    <dependency org="com.google.guava" name="guava" rev="18.0" />

and of course
as tapio suggested
, adding
GWT-Maps-V3-Api
to the project fixed the issue!

Great! I was just going to write you instructions about how to use Ivy :slight_smile:

Thanks a lot. It works great!

Hi Tapio!

thank you very much for this great add-on and great work mate!

Hi Tapio!
Thank you for this very useful add-on! It works fine!

My question:
For me it would be important to handle events on the polyline. Do you have some suggestions for extending the add-on for this case?

Javascript Workaround:
Try to call the Google Maps Javascript API “isLocationOnEdge(point:LatLng, poly:Polygon|Polyline, tolerance?:number)” where “point” is the current lat/lng mouse position.

I’ve tried to use the Javascript code directly within the init() method of MyProjectUI class:

com.vaadin.ui.JavaScript.eval("function initialize(){var myPosition = new google.maps.LatLng(43.0, -125.9, 10e-7); ... }")

…but I received the error: “google is not defined”.

Well, I also tried to insert the annotation “@JavaScript

@Theme("myproject") @JavaScript({"https://maps.googleapis.com/maps/api/js?key=MY_API_KEY"}) public class MyProjectUI extends UI { ..... } …but I received the error below from “my.package.web.widgetset.MyProjectWidgetset-0.js:10185”

SEVERE: (TypeError) : undefined is not a functioncom.google.gwt.core.client.JavaScriptException: (TypeError) : undefined is not a function

Could you help me in any way?

Thanks in advance.
Davide

Hi Tapio!
Thank for great addon!
Are you planning feature to define controlOptions?

https://developers.google.com/maps/documentation/javascript/examples/control-positioning

Is there any way I can set these options using Javascript?