IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques & Frameworks Discussion :

Qooxdoo Mobile avec Google map V3 [qooxdoo]


Sujet :

Bibliothèques & Frameworks

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Novembre 2011
    Messages
    115
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2011
    Messages : 115
    Par défaut Qooxdoo Mobile avec Google map V3
    Bonsoir à tous!

    Voila je suis bloquer depuis ce matin sur le fait d'implémenter l'api google map dans qooxdoo mais version mobile..
    Je n'y arrive pas ..
    Voici le code que j'ai essayé
    http://tinyurl.com/alwgwdn

    Il n'y as pas d'erreur mais la map ne s'affiche pas ...

    Ici il y a l'exemple avec la version desktop http://demo.qooxdoo.org/current/demo...case~Maps.html

    Merci d'avance

  2. #2
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    Pour commencer, tu peux peut-être t'inspirer de l'exemple dans le showcase mobile ICI.

    Pour le code, il est dans le SDK: qooxdoo-2.1.1-sdk\application\mobileshowcase\source\class\mobileshowcase\page\Maps.js

    C'est avec OpenLayers, mais avec Google Maps, tu peux t'inspirer du demo browser: Demos/Showcase/Maps (Google et Yahoo maps): qooxdoo-2.1.1-sdk\application\demobrowser\source\class\demobrowser\demo\showcase\Maps.js

    A+

  3. #3
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Novembre 2011
    Messages
    115
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2011
    Messages : 115
    Par défaut
    J'ai vu le source du showcase mobile mais le truc c'est qu'il utilise open layer et je veux utiliser seulement google map.
    Je me suis inspirer du demobrowser en mettant les container et layout avec les classe mobile. Mais je vois pas ou sa pêche car je n'est pas d'erreur ..
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    var __createGoogleMap = function() 
    {
      var mapContainer = new qx.ui.mobile.container.Composite(new qx.ui.mobile.layout.VBox());
    	var that = this;
     
      mapContainer.addListener("appear", function() 
    	{
        alert("map container appeared");
     
            that.__map = new google.maps.Map(document.getElementById(mapContainer.getId()), 
                {
                  zoom : 13,
                  panControl: true,
                  zoomControl: true,
                  scaleControl: true,
                  mapTypeId : google.maps.MapTypeId.HYBRID
                });      
     
            that.__map.setCenter(new google.maps.LatLng(35, 11));
     
     
       createMap();
     
       });
     
       return mapContainer;
    };
     
    var page = new qx.ui.mobile.page.NavigationPage();
    page.setTitle("google map example");
     
    page.addListener("initialize", function() {
     
      page.getContent().add(__createGoogleMap(), {flex : 1});
    },this);
     
    this.getManager().addDetail(page);
     
    page.show();
    Merci

  4. #4
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    Tu n'as pas d'erreur, mais tu as un message d'info:

    Un appel à « document.write() » d'un script externe chargé de manière asynchrone a été ignoré.
    Je n'ai jamais réussi à charger google maps api via qx.bom.request.Script().
    Aussi je fais comme cela: tinyurl.com/bumedpc

    Je suis entrain de faire la même chose avec ton appli (tinyurl.com/osqjfoo).
    Bon, je débute sur la partie mobile.

    A+

  5. #5
    Membre confirmé
    Homme Profil pro
    Étudiant
    Inscrit en
    Novembre 2011
    Messages
    115
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2011
    Messages : 115
    Par défaut
    Je débute aussi sur la partie mobile.
    Merci je vais essayer avec ton source !!

  6. #6
    Invité
    Invité(e)
    Par défaut
    Kalagan34

    Un début d'ébauche à voir ICI. (A tester sur mobile !)
    L'api google map est chargée à partir du index.html et pas à la demande.

    Pour la gestion de l'affichage de la carte, c'est pas encore cela.
    Sinon, source et build LA.

    Pour le code de la class:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    /* ************************************************************************
     
       qooxdoo - the new era of web development
     
     
    ************************************************************************ */
     
    /*
     * If you have added resources to your app remove the leading '*' in the
     * following line to make use of them.
     
    #asset(qx/mobile/css/*)
    #ignore(google)
    #ignore(google.maps.Map)
     
    ************************************************************************ */
     
    /**
     * Mobile page showing a OpenStreetMap map.
     *
     * @ignore(OpenLayers)
     */
    qx.Class.define("test3.pages.GoogleMap",
    {
      extend : qx.ui.mobile.page.NavigationPage,
     
      construct : function()
      {
        this.debug("Google Page");
     
        this.base(arguments,false);
        this.setTitle("Google Map");
        this.setShowBackButton(true);
        this.setBackButtonText("Back");
     
        this._geolocationEnabled = qx.core.Environment.get("html.geolocation");
      },
     
     
      members :
      {
        _map : null,
        _mapContainer : null,
        _geolocationEnabled : false,
        _showMyPositionButton : null,
     
        // overridden
        _initialize : function()
        {
          this.base(arguments);
     
          if(this._geolocationEnabled) {
            this._initGeoLocation();
          }
     
          this._loadMapLibrary();
     
          // Listens on window orientation change, and triggers redraw of map.
          // Needed for triggering OpenLayers to use a bigger area, and draw more tiles.
          qx.event.Registration.addListener(window, "orientationchange", this._redrawMap, this);
        },
     
        /**
         * Used the Mapnik Layer for redrawing. Needed after orientationChange event
         * and drawing markers.
         */
        _redrawMap : function () {
          this.debug("_redrawMap");
     
          var oldCenter = this._map.getCenter();
          google.maps.event.trigger(this._map, 'resize');
          this._map.panTo(oldCenter);
        },
     
        /**
         * Prepares GeoLocation, and installs needed listeners.
         */
        _initGeoLocation : function() {
          var geo = qx.bom.GeoLocation.getInstance();
          geo.addListener("position", this._onGeolocationSuccess,this)
          geo.addListener("error", this._onGeolocationError,this);
        },
     
        /**
         * Callback function when Geolocation did work.
         */
        _onGeolocationSuccess : function(position) {
          var latitude = position.getLatitude();
          var longitude = position.getLongitude();
     
          var mapPosition = new google.maps.LatLng(latitude, longitude);
          var zoom = 15;
     
          this._map.setCenter(mapPosition);
          //this._setMarkerOnMap(this._map,mapPosition);
     
          this._redrawMap();
        },
     
     
        /**
         * Callback function when Geolocation returned an error.
         */
        _onGeolocationError : function() {
          this._showMyPositionButton.setEnabled(false);
     
          var buttons = [];
          buttons.push(qx.locale.Manager.tr("OK"));
     
          var title = "Problem with Geolocation";
          var text = "Please activate location services on your browser and device."
     
          qx.ui.mobile.dialog.Manager.getInstance().confirm(title, text, function() {
          }, this, buttons);
        },
     
        /**
         * Retreives GeoPosition out of qx.bom.Geolocation and zooms to this point on map.
         */
        _getGeoPosition : function() {
          var geo = qx.bom.GeoLocation.getInstance();
          geo.getCurrentPosition(false, 1000, 1000);
        },
     
        // overridden
        _createScrollContainer : function()
        {
          // MapContainer
          var layout = new qx.ui.mobile.layout.VBox().set({
            alignX : "center",
            alignY : "middle"
          });
     
          var mapContainer = new qx.ui.mobile.container.Composite(layout);
          mapContainer.setId("googleMap");
          this._mapContainer = mapContainer;
     
          return mapContainer;
        },
     
        // overridden
        _createContent : function() {
           var menuContainer = new qx.ui.mobile.container.Composite();
           menuContainer.setId("googleMapMenu");
     
           // LABEL
           var descriptionLabel = new qx.ui.mobile.basic.Label("Page Title");
           descriptionLabel.addCssClass("googleMapLabel");
     
           // TOGGLE BUTTON
           var toggleNaviButton = new qx.ui.mobile.form.ToggleButton(true,"Show","Hide",12);
     
           // SHOW MY POSITION BUTTON
           this._showMyPositionButton = new qx.ui.mobile.form.Button("Find me!");
           this._showMyPositionButton.addListener("tap", this._getGeoPosition, this);
     
           // Button is disabled, when Geolocation is not possible.
           this._showMyPositionButton.setEnabled(this._geolocationEnabled);
     
           toggleNaviButton.addListener("changeValue", function() {
            var newNavBarState = !this.isNavigationBarHidden();
            this.setNavigationBarHidden(newNavBarState);
            this.show();
           },this);
     
           var groupPosition = new qx.ui.mobile.form.Group([this._showMyPositionButton],false);
           var groupFullScreen = new qx.ui.mobile.form.Group([descriptionLabel,toggleNaviButton],true);
     
           this._showMyPositionButton.addCssClass("map-shadow");
           groupFullScreen.addCssClass("map-shadow");
     
           menuContainer.add(groupFullScreen);
           menuContainer.add(groupPosition);
     
           return menuContainer;
        },
     
        /**
         * Loads JavaScript library which is needed for the map.
         */
        _loadMapLibrary : function()
        {
            var canvas = this._mapContainer.getContentElement();//.getDomElement();
            var mapOptions = {
              zoom      : 13,
              mapTypeId : google.maps.MapTypeId.ROADMAP,
              center    : new google.maps.LatLng(49.011899,8.403311)
            };
            this._map = new google.maps.Map(canvas, mapOptions);
            this._mapContainer.addListener("resize", this._redrawMap);
     
        },
     
        // overridden
        _back : function()
        {
          //qx.core.Init.getApplication().getRouting().executeGet("/", {reverse:true});
        },
     
     
        /*
        *****************************************************************************
          DESTRUCTOR
        *****************************************************************************
        */
        destruct : function()
        {
     
        }
      }
    });
    A+

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Calcul de distance avec Google Map
    Par jouclar dans le forum Réseau/Web
    Réponses: 6
    Dernier message: 22/04/2010, 15h58
  2. [PHP 5.0] file_get_contents avec Google Maps
    Par Invité dans le forum Langage
    Réponses: 1
    Dernier message: 17/01/2010, 10h58
  3. Recuperer nom du pays avec GOOGLE MAP
    Par alas70 dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 23/10/2008, 22h21
  4. Pb avec google map
    Par dolfendo dans le forum GWT et Vaadin
    Réponses: 4
    Dernier message: 15/05/2008, 21h45
  5. [Tableaux] Géocodage avec Google Maps
    Par julien75000 dans le forum Langage
    Réponses: 3
    Dernier message: 11/09/2007, 21h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo