30 Apr 2012 12:12 PM #1
Use of GMapPanel
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.
3 May 2012 2:27 PM #2
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
Sencha Architect Development Team
6 May 2012 4:44 AM #3
Would it not be simpler to just create and add the map component via the onRender event of the view.