1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    6
    Vote Rating
    0
    muddsg is on a distinguished road

      0  

    Default Unanswered: Cannot create an instance of unrecognized alias:

    Unanswered: Cannot create an instance of unrecognized alias:


    Hi everyone, i am new to Sencha and i have an application that should display the map with a search field at the bottom of the map. The map will show your current location with a marker and the address search from the search field will place a second marker on the map. But i have been constantly getting this

    Uncaught Error: [Ext.createByAlias] Cannot create an instance of unrecognized alias: widget.maps
    and the screen just show a blank page .

    This is the code below.

    Code:
    
    
    Code:
    Ext.define('demo.view.Maps', {
        extend:'Ext.Panel',
        extend: 'Ext.Map',
    	extend: 'Ext.List',
        xtype:'maps',
    
    
        config: {
            title:'Maps',
            iconCls:'maps',
            layout:'vbox',
            draggable: true,
            useCurrentLocation: true,  
    		
    		listeners: {
                maprender : function(comp, map){
                    new google.maps.Marker({
                        position: new google.maps.LatLng(this._geo.getLatitude(), this._geo.getLongitude()),
                        map: map
                    });     },
    				mapOptions: {
    		zoom: 20,
    		mapTypeId: google.maps.MapTypeId.HYBRID   }    
     }
    },
    			xtype:'toolbar',
                
                items:[{
    			docked:'bottom', 
                    xtype: 'searchfield',
                    itemId:'Address',  
                    placeHolder: 'Search Address'  
                }]
    }
    );
    
    
    var geocoder;
    var map;
    var marker;
    
    
    			
    function initialize(){
            
    map = new google.maps.Map(document.getElementByName("searchfield"));
            
      //GEOCODER
    geocoder = new google.maps.Geocoder();
            
    marker = new google.maps.Marker({
        map: map,
        draggable: true
      }) };
    		
    
    
    $(document).ready(function() { 
    	initialize();
    				  
      $(function() {
        $("#Address").autocomplete({
          //This bit uses the geocoder to fetch address values
          source: function(request, response) {
            geocoder.geocode( {'Address': request.term }, function(results, status) {
              response($.map(results, function(item) {
                return {
                  label:  item.formatted_address,
                  value: item.formatted_address,
                  latitude: item.geometry.location.lat(),
                  longitude: item.geometry.location.lng()
                }
              }));
            })
          },
          //This bit is executed upon selection of an address
          select: function(event, ui) {
            $("#latitude").val(ui.item.latitude);
            $("#longitude").val(ui.item.longitude);
            var location = new google.maps.LatLng(ui.item.latitude, ui.item.longitude);
            marker.setPosition(location);
            map.setCenter(location);
          }
        });
    }
    )});


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


    You have three extend properties at the top of your class... which do you want?

    You are also using jQuery, there really is no need for jQuery at all and will affect performance.
    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.

Thread Participants: 1

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