Permalink
Browse files

Some requirements added to get the Map working with sencha touch 2 de…

…pendencies mecanism.
  • Loading branch information...
1 parent d0a9dfd commit 6009ffdabf9f3d26882fe1a5462fef1c78435d65 @pgiraud committed Apr 17, 2012
Showing with 15 additions and 9 deletions.
  1. +2 −1 lib/GXM/data/LayerStore.js
  2. +2 −2 lib/GXM/data/models/Layer.js
  3. +11 −6 lib/GXM/widgets/Map.js
@@ -24,14 +24,15 @@
*/
Ext.define('GXM.data.LayerStore', {
extend: 'Ext.data.Store',
+ requires: ['GXM.data.models.Layer'],
config: {
/** api: config[model]
*
* ``String`` The identifier for the model to be used.
* Defaults to ``gxm_layer``.
*/
- model: 'gxm_layer',
+ model: 'GXM.data.models.Layer',
/** api: config[proxy]
*
@@ -42,7 +42,7 @@
* as string representation as a config option within creation of a superior component,
* for example a store.
*/
-Ext.define('gxm_layer', {
+Ext.define('GXM.data.models.Layer', {
extend: "Ext.data.Model",
config: {
fields: [
@@ -61,4 +61,4 @@ Ext.define('gxm_layer', {
getLayer: function(){
return this.raw;
}
-});
+});
View
@@ -24,7 +24,7 @@
*
* Ext.setup({
* onReady: function(){
- * var mp = Ext.create('GXM.Map', {
+ * var mp = Ext.create('GXM.widgets.Map', {
* layers: [
* // an array of OpenLayers.Layer-objects
* ],
@@ -43,10 +43,15 @@
*
* The class that is used to build a GXM map.
*/
-Ext.define('GXM.Map', {
+Ext.define('GXM.widgets.Map', {
extend: 'Ext.Component',
xtype : 'gxm_map',
+
+ requires: [
+ 'GXM.util.Base',
+ 'GXM.data.LayerStore'
+ ],
// both 'layers' and 'controls' are not defined via 'config'-object,
// so that we do not ave to decide what happens on call of e.g.
@@ -361,7 +366,7 @@ function() {
// backwards compatibility
Ext.define('GXM.MapPanel', {
// possibly better suited would be override, but this works.
- extend: 'GXM.Map',
+ extend: 'GXM.widgets.Map',
initialize: function (config) {
//<debug warn>
Ext.Logger.deprecate("The class 'GXM.MapPanel' is deprecated, please use 'GXM.Map' instead", this)
@@ -370,7 +375,7 @@ function() {
}
});
- GXM.util.Base.createConfigAlias(GXM.Map, 'center', 'mapCenter');
- GXM.util.Base.createConfigAlias(GXM.Map, 'zoom', 'mapZoom');
- GXM.util.Base.createConfigAlias(GXM.Map, 'extent', 'mapExtent');
+ GXM.util.Base.createConfigAlias(GXM.widgets.Map, 'center', 'mapCenter');
+ GXM.util.Base.createConfigAlias(GXM.widgets.Map, 'zoom', 'mapZoom');
+ GXM.util.Base.createConfigAlias(GXM.widgets.Map, 'extent', 'mapExtent');
});

0 comments on commit 6009ffd

Please sign in to comment.