1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    76
    Vote Rating
    0
    stoertebeker is on a distinguished road

      0  

    Default Use of GMapPanel

    Use of GMapPanel


    Hi,
    I would like to include a map with my current project. Since this class is not coming from Sencha it is not part of the Toolbox. How do I technically solve this? Without using Architect it looks pretty simple. From some search and reading I have done I understand that the options is: override of a custom panel. How would the code look like? I tried to find some documentation on how to implement such an override, but wasn't successful.
    Thanks.

  2. #2
    Sencha - Architect Dev Team jjohnston's Avatar
    Join Date
    Sep 2010
    Posts
    461
    Vote Rating
    15
    jjohnston will become famous soon enough jjohnston will become famous soon enough

      0  

    Default


    I assume you are speaking about a Ext JS app, because Sencha Touch does indeed have a Map component available in the toolbox.

    To implement a map within a component in Ext JS using Architect, you would indeed have to create an override class and implement custom code to create the map within that class. The basics of how to create an override are covered under "Creating overrides" in http://docs.sencha.com/architect/2-0...de/views_intro

    Once you have the override created, you'll implement your code there. This, of course, is the difficult part. Unfortunately how you do this is pretty much up to you -- I'd suggest looking around for existing GMap component implementations, e.g. https://github.com/VinylFox/ExtJS.ux.GMapPanel/ -- or at its simplest you could override e.g. the 'render' method and instantiate your map there and insert it into the component's element.

    Unfortunately the override code will not be executed in Architect's visual canvas so you will not see your map displayed there and will need to deploy/preview your app to see it in action.

    I hope that helps. If you need more help on the specifics of the implementation I'd suggest posting in one of the non-Architect forums as you're more likely to get code related assistance there.
    Jason Johnston
    @lojjic
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Aug 2008
    Posts
    51
    Vote Rating
    7
    TonySteele is on a distinguished road

      0  

    Default


    Would it not be simpler to just create and add the map component via the onRender event of the view.

Thread Participants: 2