1. #1
    Sencha User
    Join Date
    May 2008
    Posts
    262
    Vote Rating
    -4
    mnask79 is infamous around these parts

      0  

    Default Unanswered: map in galaxy note

    Unanswered: map in galaxy note


    hi guys ,

    when i display the map on my mobile , its not displaying very well , find the screen shot please

    Screenshot_2012-11-18-22-59-22.jpg


    Code:
    
    var map1 = Ext.create('Ext.Map', { 
        title : 'Map',
        id: 'google-map-id',
        layout : 'fit',
        flex:1
        
    });
    
    
    Ext.define('landmarks.view.landmark.Path', {
        extend: 'Ext.Container',
        xtype: 'landmark-path',
    
        config: {
            
            layout: 'vbox',
    
            items: [
                {
                    id: 'content',
                    tpl: [
                        '<div>',                        
                            '<div >{lname_e} </span></div>',
                        '</div>'
                    ].join('')
                },
                map1
            ],
    
            record: null
        },
    
        updateRecord: function(newRecord) {
            if (newRecord) {
            
                this.down('#content').setData(newRecord.data);  
                
                Ext.device.Geolocation.getCurrentPosition({
                    allowHighAccuracy: true,
                    success: function(position) {                
                    
                        latitude = position.coords.latitude
                        longitude = position.coords.longitude ;        
                        
                        var start = new google.maps.LatLng(latitude, longitude);
                        var end = new google.maps.LatLng(newRecord.data.lat, newRecord.data.lng);
                        var request = {
                            origin:start,
                            destination:end,
                            travelMode: google.maps.DirectionsTravelMode.WALKING
                        };
                        directionsService.route(request, function(response, status) {
                          if (status == google.maps.DirectionsStatus.OK) {
                            directionsDisplay.setDirections(response);
                          }
                        });                    
                    },
                    failure: function() {
                        Ext.Msg.alert('Geolocation', 'Something went wrong!');
                    }
                });             
            }
        }
    });

    can you help me please

    regards

  2. #2
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    567
    Answers
    34
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default fire change size on map

    fire change size on map


    Usually it helps if you fire a size change event on the map.
    That way it tells google maps to update the map

  3. #3
    Sencha User
    Join Date
    May 2008
    Posts
    262
    Vote Rating
    -4
    mnask79 is infamous around these parts

      0  

    Default


    how to "fire change size on map " ? would you please post some script

  4. #4
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    567
    Answers
    34
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default


    Code:
    google.maps.event.trigger(SenchaMap.getMap(), 'resize');

  5. #5
    Sencha User
    Join Date
    May 2008
    Posts
    262
    Vote Rating
    -4
    mnask79 is infamous around these parts

      0  

    Default


    thanks for help , i found this solution here http://www.sencha.com/forum/showthre...ce-Orientation

    and i added to the view , but it does not work , i'm sorry , would u tell me where i should add the script line ?

    BR

  6. #6
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    567
    Answers
    34
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default


    Add it to the geocoder update method if a map is currently displayed (depends on the frequency of your geolocator (Ext.util.Geolocation).

    An alternative could be to fire it 500ms after orientation change or after showing the map.

  7. #7
    Sencha User
    Join Date
    May 2008
    Posts
    262
    Vote Rating
    -4
    mnask79 is infamous around these parts

      0  

    Default


    HTML Code:
    var map1 = Ext.create('Ext.Map', { 
        title : 'Map',
        id: 'google-map-id',
        layout : 'fit',
        flex:1,
        listeners: {
            maprender : function(map, gmap, options){
                //
                Ext.Function.defer(function(){
                    google.maps.event.trigger(component.googleMap.map, 'resize'); 
                }, 500);
                
                
            }
        }
        
    });
    this is not working , also im getting the following error

    PHP Code:
    Uncaught ReferenceErrorcomponent is not defined Path.js:95Ext.device.Geolocation.getCurrentPosition.successPath.js:95Ext.apply.listeners.locationupdateSimulator.js:17Ext.define.doFireController.js:197Ext.define.fireController.js:124Ext.define.doDispatchEventDispatcher.js:341Ext.define.dispatchEventDispatcher.js:322Ext.define.doFireEventObservable.js:235Ext.define.fireEventObservable.js:194Ext.define.fireUpdateGeolocation.js:356(anonymous function) 

  8. #8
    Sencha User
    Join Date
    May 2008
    Posts
    262
    Vote Rating
    -4
    mnask79 is infamous around these parts

      0  

    Default


    is it bug ? or problem from Galaxy note , or problem in my script ?

    is this problem fixed in 2.1 ?

  9. #9
    Sencha User
    Join Date
    May 2008
    Posts
    262
    Vote Rating
    -4
    mnask79 is infamous around these parts

      0  

    Default


    excuse me , but really this forum is not active like other forums , i face a problem , and i need to solve it , i have tried manything , can you help me please ?

  10. #10
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    567
    Answers
    34
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default


    Quote Originally Posted by mnask79 View Post
    HTML Code:
    var map1 = Ext.create('Ext.Map', { 
        title : 'Map',
        id: 'google-map-id',
        layout : 'fit',
        flex:1,
        listeners: {
            maprender : function(map, gmap, options){
                //
                Ext.Function.defer(function(){
                    google.maps.event.trigger(component.googleMap.map, 'resize'); 
                }, 500);
            }
        }
        
    });
    this is not working , also im getting the following error

    PHP Code:
    Uncaught ReferenceErrorcomponent is not defined Path.js:95
    Ext
    .device.Geolocation.getCurrentPosition.success Path.js:95
    Ext
    .define.fireUpdateGeolocation.js:356(anonymous function) 
    I am sorry you are not getting help. But this usually is a cross mix between not-enough-info posted and not being able to understand the problem.

    Here are some thoughts:
    1) What are you using layout: 'fit' for?
    2) Put an alert into the maprender listener and see at what time it is firing. Is this the time when you need it to fire? Does the map exist at that point in the creation process?
    3) The listener gives you a gmap. What is that good for. Could you use it inside the defer?
    4) When the defer is triggering the resize event, is the map still or already there?

Thread Participants: 1