Results 1 to 3 of 3

Thread: Sencha touch + Openlayers

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    5
    Vote Rating
    0
      0  

    Default Sencha touch + Openlayers

    Any help would be greatly appreciated.

    I have a tab Panel with a "map" and "layer" icons on the bottom. sample code as below :

    Code:
    items: [
                {
                    xtype: 'container',
                    title: 'Map',
                    iconCls: 'maps',
                    items: [
                       {
                           xtype: 'mapview'
                       }
                    ]
                },
                {
                    xtype: 'container',
                    title: 'Layers',
                    iconCls: 'bookmarks',
                    layout: 'vbox',
                    items: [
    
    
                            { xtype: 'layerlist', flex: 1 }
                       
                        ]
                }
            ],
            tabBar: {
                docked: 'bottom',
                layout: {
                    pack: 'center',
                    type: 'hbox'
    the xtype: 'mapview' needs to display a view in my Views folder which needs to display the openlayer map. I have tried to display the map in the onpainted function but in vain.

    Can someone point me in the right direction please? as I'm unable to render the map in the child component. The map just refuses to display.

    Appreciate any help.
    Thanks.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    You should look to see how Ext.Map renders the google map.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jul 2015
    Location
    morocco
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Ext.define('test.view.map', {
    extend: 'Ext.Panel',
    xtype: 'map1',
    requires: ['Ext.Panel'],
    config: {
    iconCls: 'maps',
    title: 'carte',
    items: [{
    xtype: 'panel',
    id: 'maMape',
    // fullscreen:true,
    // centered:true,
    layout: {
    type: 'fit'
    },
    listeners: {
    painted: function() {

    var map = new ol.Map({
    target: 'maMape',
    layers: [
    new ol.layer.Tile({
    source: new ol.source.OSM()
    }),
    vectorLayer1,
    vectorLayer2...
    ],


    view: new ol.View({
    projection: maprojection,
    center: ol.proj.transform([x0,y0], 'EPSG:4326', 'EPSG:3857'),
    zoom: 12
    }),
    controls: ol.control.defaults().extend([
    new ol.control.ScaleLine()
    ]),
    interactions: ol.interaction.defaults().extend([select, modify])
    });



    }
    }
    }]
    }




    });

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •