1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    13
    Vote Rating
    0
    oswaldo.gh89 is on a distinguished road

      0  

    Default The marker map is not working, it is not showing .. help!

    The marker map is not working, it is not showing .. help!


    I'm working with an example that I found online, but the map marker is not shown, do not understand that .. Now change the path of the icon and nothing .. eh already tried everything, I did not make any errors on the console.

    I leave the code I'm using to see if I can help ... Greetings to all the community sencha.

    this is my view
    Code:
    Ext.define('ValkMob.view.Mapa',{
     extend: 'Ext.Map',
     xtype: 'mapas',
     config: {
      mapOptions: {
       center: new google.maps.LatLng (23.754514,-99.130546),
       mapTypeId: google.maps.MapTypeId.ROADMAP,
       zoom: 17
      }
     },
     initialize: function() {
       var gMap = this.getMap();
       
       // add traffic layer
       var trafficLayer = new google.maps.TrafficLayer();
       trafficLayer.setMap(gMap);
       
       // add panoramio layer
       var panoramioLayer = new google.maps.panoramio.PanoramioLayer();
       panoramioLayer.setMap(gMap);
       
       // drop map marker
       var marker = new google.maps.Marker({
        map: gMap,
        animation: google.maps.Animation.DROP,
        position: new google.maps.LatLng (23.754514,-99.130546),
        icon: 'map_marker.png'
       });
     }
    });

  2. #2
    Sencha User
    Join Date
    Aug 2012
    Posts
    13
    Vote Rating
    0
    oswaldo.gh89 is on a distinguished road

      0  

    Default


    Anyone can help me?

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Vote Rating
    750
    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


    1) You are overriding initialize without executing the callParent so you are breaking inheritance
    2) You should use the maprender event to add a marker
    3) Please don't reply to your thread with things like 'Anyone can help me?', give people some time especially over the weekend and a holiday weekend. Posts like this can actually turn people off from helping you.
    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. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    13
    Vote Rating
    0
    oswaldo.gh89 is on a distinguished road

      0  

    Default


    The problem is not the code .. the problem is in the sencha touch version 2.1.0, the same code without any modification as probe in sencha touch 2.0.1 and worked perfectly ... A greeting and thanks for replying.

  5. #5
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    175
    Vote Rating
    13
    EPV will become famous soon enough

      0  

    Default


    I agree with mitchellsimoens, you should listen to the event "maprender" and add your markers there:
    http://docs.sencha.com/touch/2.2.1/#!/api/Ext.Map-event-maprender

    Good luck / E

  6. #6
    Sencha User =NR='s Avatar
    Join Date
    Mar 2013
    Location
    Singapore
    Posts
    91
    Vote Rating
    1
    =NR= is on a distinguished road

      0  

    Default


    Quote Originally Posted by EPV View Post
    I agree with mitchellsimoens, you should listen to the event "maprender" and add your markers there:
    http://docs.sencha.com/touch/2.2.1/#!/api/Ext.Map-event-maprender

    Good luck / E
    in case of your application will show the map after user click some button:
    • Make sure to do the map location update on maprender event (otherwise the Ext.Map.map might return null because the component hasn't been rendered)
    • Make the button click just to show the map (it will kind of trigger the map to be rendered)
    • Always make sure you have reference to Ext.Map.map when you want to add the marker otherwise the marker won't be displayed as it is being added to a null object
    One last thing is that I need to confirmed that if we are using 1 "Ext.Map" component and just play around with it (such as using carousel layout which make user can make the mapview active or not) will the maprender event be fired every time the map is active item ?(everytime the container holding it become active item)

Thread Participants: 3

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar