1

com.vaadin.tapio.googlemaps.GoogleMap コンポーネントを使用して、vaadin から Google マップに接続しました。

以下のコードを試してみました。(Vaadin 7.0.2)

public class StoresMainView extends VerticalLayout implements View {

    @Override
    public void enter(ViewChangeEvent event) {
        setSizeFull();


        GoogleMap googleMap = new GoogleMap(new LatLon(-27.47101, 153.02429), 10.0, "");
        googleMap.setSizeFull();
        googleMap.setImmediate(true);
        googleMap.setMinZoom(4.0);
        addComponent(googleMap);


    }

しかし、実行時に以下のエラーが発生します.pomに依存関係を追加しました.

Widgetset does not contain implementation for com.vaadin.tapio.googlemaps.GoogleMap. Check its component connector's @Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.

私のweb.xmlでは、以下のようにウィジェットセットを定義しています

 <init-param>
        <param-name>widgetset</param-name>
        <param-value>com.client.DashboardWidgetSet</param-value>
    </init-param>

そして、以下のように私の DashboardWidgetSet

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
    <inherits name="com.vaadin.DefaultWidgetSet" />

    <inherits name="org.vaadin.cssinject.Cssinject_addonWidgetset" />
    <!--  -->

    <set-configuration-property name="devModeRedirectEnabled"
        value="true" />

    <!-- Uncomment the following to compile the widgetset for one browser only. 
        This can reduce the GWT compilation time significantly when debugging. The 
        line should be commented out before deployment to production environments. 
        Multiple browsers can be specified for GWT 1.7 as a comma separated list. 
        The supported user agents at the moment of writing were: ie6,ie8,gecko,gecko1_8,safari,opera 
        The value gecko1_8 is used for Firefox 3 and later and safari is used for 
        webkit based browsers including Google Chrome. -->
    <!-- <set-property name="user.agent" value="safari"/> -->

    <!-- WidgetSetOptimizer -->

    <inherits name="org.vaadin.easyuploads.Widgetset" />

    <inherits name="com.vaadin.tapio.googlemaps.WidgetSet" />

</module>

どんな助けでも本当に感謝しています。

4

1 に答える 1

0

web.xml のウィジェットセット init-param が正しいウィジェットセットを指していることを確認する必要があります。デフォルトのものには、Google マップ コンポーネントのウィジェットに関する情報は含まれていません。

于 2013-10-08T05:52:41.917 に答える