1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    12
    Answers
    1
    Vote Rating
    0
    jorik12345 is on a distinguished road

      0  

    Default Answered: Google Markers Disappear after build

    Answered: Google Markers Disappear after build


    He Guys,

    Having a weird issue here. I'm trying to build my app (production) for the use of a web app. I have added Google Markers on a map and everything works fine. In development mode. If I try to build my app for production the markers just disappear.

    I thought that maybe some files aren't loaded from google but my map works fine. Does anyone have an idea how to fix this problem??

    Production:
    http://haarlem.jr-productions.nl

    Development:
    http://haarlem.jr-productions.nl/OLD

    And the code of my Map.js file:
    PHP Code:
    Ext.define('Haarlem.view.Map', {
        
    extend'Ext.NavigationView',
        
    xtype'getMap',
        
        
    config: {
            
    navigationBar: {
                
    items: [
                    {
                      
    iconCls'search',
                      
    iconMasktrue,
                      
    align'left'
                    
    },
                    {
                        
    xtype'button',
                        
    html'Lijst',
                        
    action'showlist',
                        
    ui'normal'
                    
    },
                    {
                        
    html'Kaart',
                        
    action'showmap'
                    
    },
                    {
                      
    iconCls'locate',
                      
    iconMasktrue,
                      
    align'right'
                    
    }
                ]
            },
            
    items: [
                    {
                        
    xtype'map',
                        
    fullscreen'true',
                        
    layout'fit',
                        
                        
    isMaptrue,
                        
    mapOptions:{
                            
    center : new google.maps.LatLng(52.385643863597834.631771347045898),
                              
    clickabletrue,
                              
    draggabletrue,
                            
    zoom 13,
                            
    mapTypeId google.maps.MapTypeId.ROADMAP,
                            
    navigationControltrue,
                            
    navigationControlOptions: {
                                
    stylegoogle.maps.NavigationControlStyle.DEFAULT
                            }        
                        },
                        
    listeners: [
                            {
                                
    fn'onMapRender',
                                
    event'maprender'
                            
    }
                        ],
                        
                        
    onMapRender: function(mapgmap){
                    
                                var 
    createBtn Ext.create('Ext.Button', {
                                    
    displaytrue,
                                    
    html'<table><tr><td rowspan="2"><img src="http://www.threehouse.nl/disgover/sites/default/files/image_phpxNsxtl.jpg" alt="" width="50" height="50" /></td><td><b style="font-size:13px;">Gedempte Oude Gracht 1</b></td></tr> <tr><td><span style="font-size:11px;">14 kantoor units - 30m2 per unit </td></tr></table>'
                                
    });
                    
                                var 
    panden = new Array();
                                    
    panden.push({lat52.379409lon4.633536info'<table style="line-height:15px;"><tr><td rowspan="3"><img src="http://www.threehouse.nl/disgover/sites/default/files/image_phpxNsxtl.jpg" alt="" width="50" height="50" /></td><td><b style="font-size:13px;">Gedempte Oude Gracht 1</b></td></tr> <tr><td><span style="font-size:11px;">14 kantoor units - 30m2 per unit </td></tr><tr><td><a style="font-size:11px; color:#7e1712" href="#">Klik hier voor meer info ></a></td></tr></table>' });
                                    
    panden.push({lat52.377285lon4.636545info'<table style="line-height:15px;"><tr><td rowspan="3"><img src="http://www.threehouse.nl/disgover/sites/default/files/oude_postkantoor_nieuwe_stadskantoor_haarlem.jpg" alt="" width="50" height="50" /></td><td><b style="font-size:13px;">Gedempte Oude Gracht 2</b></td></tr> <tr><td><span style="font-size:11px;">20 kantoor units - 10m2 per unit</td></tr><tr><td><a style="font-size:11px; color:#7e1712" href="#">Klik hier voor meer info ></a></td></tr></table>' });
                                    
    panden.push({lat52.382536lon4.637946info'<table style="line-height:15px;"><tr><td rowspan="3"><img src="http://www.threehouse.nl/disgover/sites/default/files/53374086.jpg" alt="" width="50" height="50" /></td><td><b style="font-size:13px;">Jansstraat 46</b></td></tr> <tr><td><span style="font-size:11px;">99 werkruimtes - 20m2 per werkruimte</td></tr><tr><td><a style="font-size:11px; color:#7e1712" href="#">Klik hier voor meer info ></a></td></tr></table>' });
                                    
    panden.push({lat52.385302lon4.623874info'<table style="line-height:15px;"><tr><td rowspan="3"><img src="http://www.threehouse.nl/disgover/sites/default/files/5718779073_e6ff82af49_z.jpg" alt="" width="50" height="50" /></td><td><b style="font-size:13px;">Zijlweg 120</b></td></tr> <tr><td><span style="font-size:11px;">Winkelpand - 200m2</td></tr><tr><td><a style="font-size:11px; color:#7e1712" href="#">Klik hier voor meer info ></a></td></tr></table>' });
                                    
    panden.push({lat52.3823156lon4.6294017info'<table style="line-height:15px;"><tr><td rowspan="3"><img src="http://www.threehouse.nl/disgover/sites/default/files/10483-500-408.jpg" alt="" width="50" height="50" /></td><td><b style="font-size:13px;">Gemeentehuis Haarlem</b></td></tr> <tr><td><span style="font-size:11px;">20 kantoor units - 10m2 per unit</td></tr><tr><td><a style="font-size:11px; color:#7e1712" href="#">Klik hier voor meer info ></a></td></tr></table>' });
                                
                                
    //var getLocation = Ext.getStore('pandenStore');
                                
                                //console.log(getLocation);
                                /*
                                getLocation.each(function(record, object) {
                                      panden.push({lat: record.get('lat'), lon: record.get('lng'), info: '<b>'+record.get('title') + '</b><br />' + record.get('indeling')}); 
                                  });
                                */
                                
    for (var 0panden.lengthi++) {
                                            var 
    position = new google.maps.LatLng(panden[i].latpanden[i].lon)
                                    
    item = new google.maps.Marker({
                                        
    positionposition,
                                        
    mapgmap,
                                        
    draggablefalse,
                                        
    animationgoogle.maps.Animation.DROP
                                    
    });
                                    
                                    var 
    infowindow = new google.maps.InfoWindow();
                                    
                                    
    google.maps.event.addListener(item'click', (function(itemi) {
                                           return function() {
                                             
    infowindow.setContent(panden[i].info);
                                             
    infowindow.open(mapitem);
                                             
    gmap.setPosition(position);
                                           }
                                     })(
    itemi));
                                    
                                    
    google.maps.event.addListener(infowindow'closeclick', (function() {
                                        
    //alert('test');
                                    
    })(infowindowi));
                                     
                                }
                            }


                }
            ]
         }
    }); 
    Thanks.

  2. Any JS errors? Your use of listeners may not be suitable...

    try

    Code:
    listeners : {
        maprender : function(map, gmap) {....}
    }

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Answers
    3461
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Any JS errors? Your use of listeners may not be suitable...

    try

    Code:
    listeners : {
        maprender : function(map, gmap) {....}
    }
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    12
    Answers
    1
    Vote Rating
    0
    jorik12345 is on a distinguished road

      0  

    Default


    Damn you are absolutely right. That was the solution. I'm going to remind that for the future!
    Thanks!

Thread Participants: 1