1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    0
    houas is on a distinguished road

      0  

    Default Unanswered: How to load GeoJson file with sencha touch

    Unanswered: How to load GeoJson file with sencha touch


    I work for a project of mobile application with sencha touch, and I have a problem with my models to retreive informations. i will show you my model and my json file content


    json file : ( i make it very simple just to test, i deleted the geometry line)

    Code:
    {
            "type": "FeatureCollection",
            "features": [
                {
                "properties": {
                               "graphic": "img/restaurant.png",
                                 "Name": "Igor Tihonov",
                                "Country":"Sweden", 
                                 "City":"Gothenburg"}
                }
    
    
            ]
    }
    My model :

    Code:
    Ext.regModel('Features', {
            hasMany: {model: 'Properties', name: 'properties'}
    
    
        });
    
    
    
    
        Ext.regModel('Properties', {
            fields: ['graphic', 'Name', 'Country', 'City'],
            associations: [
                {type: 'belongsTo', model: 'Features'}
            ]
        });
    Store :
    Code:
     Ext.data.Store({        model: 'Features',
            proxy: {
                type: 'ajax',
                url : 'poi2.json',
                reader: {
                    type: 'json',
                    rootProperty: 'features'
                }
            },
            autoLoad:true 
        });
    i have more than a week since i'm blocked, i wish that you could help me ! thank you

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Answers
    124
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi hauos,

    Add fields config into the Features model.

    Code:
    
    Ext.regModel('Features', 
    {
            fields:['features'],
            hasMany: {model: 'Properties', name: 'properties'}
        }); 
       Ext.regModel('Properties', 
    { 
           fields: ['graphic', 'Name', 'Country', 'City'],
            associations: [
                {type: 'belongsTo', model: 'Features'}
            ] 
       });
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    0
    houas is on a distinguished road

      0  

    Default


    thx for reply but nothing change dude !
    i also dont understand why i have to add fields config into the Features model while i have no field into it ?

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi