vendredi 30 mai 2014

Displaying Mapquest map in ExtJs single-page aplication - Ext 4.2.2

I am having a problem using the Mapquest API to render a Mapquest map in an ExtJS panel.

I've done the following:



Code:



generateMap: function(){
var mapPanel = Ext.create('Ext.panel;
var mapOptions = {
elt: mapPanel.body.dom, /*ID of element on the page where you want the map added*/
zoom: 10, /*initial zoom level of the map*/
latLng: { lat: 40, lng: -78 }, /*center of map in latitude/longitude */
mtype: 'map', /*map type (map)*/
bestFitMargin: 0, /*margin offset from the map viewport when applying a bestfit on shapes*/
zoomOnDoubleClick: true /*zoom in when double-clicking on map*/
};
var map = new MQA.TileMap(mapOptions);



return mapPanel;
}

I believe that this code is correct. (Please alert me to any problems you see!)

As such, I'm very confused as to why my panel is not displaying a Mapquest map.


If anyone has any input, I'd be most appreciative!


Thank you!





Aucun commentaire:

Enregistrer un commentaire