Issue loading GmapPanel in Sencha Ext JS 4.0

Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', '../ux');
Ext.require([
    'Ext.window.*',
    'Ext.ux.GMapPanel'
]);

Ext.onReady(function() {
    var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});
        myMask.show();

        var layout = Ext.create('Ext.panel.Panel', {
            //renderTo: 'layout',
            width: window.innerWidth,
            height: window.innerHeight,
            //title: 'Border Layout', //no title will be blank
            layout: 'border',
            items: [{
                title: 'Message List',
                region: 'south',     // position for region
                xtype: 'panel',
                height: 100,
                split: true,         // enable resizing
                collapsible: true,
                margins: '0 5 5 5',
                collapsed: true
            },{
                //title: 'Map',
                region: 'center',    
                xtype: 'gmappanel',
                center: {geoCodeAddr: '4 Yawkey Way, Boston, MA, 02215-3409, USA',marker: {title: 'Fenway Park'}}
            }],
            renderTo: Ext.getBody() //get the body and display Layout at there
        }); 
        myMask.hide();
});

Question

  1. What could be causing the gmappanel not to load?

  2. I want to display a Loading Mask until the page fully loads and then remove it. How can I achieve this?

Answer №1

area: 'central',     // essential central area, no specific dimensions given
                type: 'locationpanel',
                identifier : 'mylocationmap',
                locationOptions: ['enableZoom','enablePan','enableDrag'],
                locationControls: ['SmallMapControl','MapTypeControl','CustomControl'],   
                zoomLevel: 5,
                mapType: 'terrain',
                centerPoint: {geoLocationAddr: 'Singapore'}

Feel free to try out this code and see if it works for your needs.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

React throws an error when attempting to switch to a login element with an invalid return type

I'm encountering difficulties connecting my login and signup pages to the home page in React. Here is the project's basic structure: --src --assets --components --elements --layout --login_components Login.js --signup_c ...

Typescript is throwing a Mongoose error stating that the Schema has not been registered for the model

I've dedicated a lot of time to researching online, but I can't seem to figure out what's missing in this case. Any help would be greatly appreciated! Permission.ts (This is the Permission model file. It has references with the Module model ...

Using setTimeout in a recursive function

Utilizing a recursive function to retrieve data from an external source, process it, and make additional calls if required. I require a method to pause prior to calling this external source numerous times in succession. How can I guarantee that I have co ...

Customizing the step function of HTML5 input number with jQuery: A guide

Is there a way to modify the step value in HTML5 number inputs for my web application? I would like it to increment and decrement by 100 instead of 1. I attempted the following approach: $("#mynumberinput").keydown(function(e){ if (e.keyCode == 38) / ...

The mouse pointer position in THREE.js does not align with the arrow tip during events

I am currently grappling with figuring out how to accurately determine the position of click events on the screen while using THREE.js alongside an Orthographic camera. Unfortunately, the position that I have managed to calculate (similarly to what is des ...

Revise an existing object by incorporating new information from a different object

One issue I am facing is related to a "Product" class that I use for creating and displaying products on my website. The constructor of this class looks like this: constructor(title, price, description, imageUrl, id). To update an existing product with new ...

Issues with HTML5 file uploads causing delays in iOS Safari mobile browsers

I developed a simple HTML5 file upload script using $.ajax(). I also attempted to use xhr, but encountered the same issue. The script successfully uploads an image to imgur.com and works flawlessly on desktop browsers as well as iOS Safari. However, in iOS ...

Activate radio button exclusively for admin user

My current application includes an admin panel with functions to manage users. I use a while loop in the form creation to display 3 user types: Admin, Manager, and User, which are pulled from a database. Admin Manager User This is how my HTML Form look ...

Issue encountered when attempting to trigger an ionic modal from a custom control in Google Maps

I am facing an issue with my custom Google map control in Ionic framework. I want the control to open a modal when clicked, but I keep getting an error "Cannot read property '$$destroyed' of undefined" when I try to do so. On the other hand, anot ...

Using JQuery Ajax to send a parameter containing a backslash

On my web page, I am utilizing an input array: <input id='idInput[1]' /> Using a JavaScript function, I am able to set the value of this input: $('#idInput\[1\]').val(5); The issue arises when I need to send the ID ...

JavaScript implementations of basic Prolog predicates

Are there any proven methods for defining simple prolog predicates and asserting facts in javascript client code? I came across which seems to rely on a server-side "toy" interpreter. ...

How can we restrict the text within a child div to a specific number of characters based on the size of the parent div?

So, imagine your HTML elements arranged as follows: <div class="Main"> <div class="About_Sports"> <div class="sportsPhoto"> <div class="content"> <di ...

JavaScript Global Variables Keep Getting Reset

Here's the concept behind my project: I've created a simple game that utilizes a do/while function and a switch statement to determine the player's current room. When the player is in room 1, the switch selects room1 and executes the room1() ...

Warning: Unhandled promise rejection - Type error encountered when trying to access property

While working on a simple login validation, I encountered an issue when deliberately inputting an incorrect email in the login post method via postman. UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'password' of null at C:&b ...

I'm having some trouble with this error while trying to install nodemon globally using npm. How can I troub

Currently, I am diving deep into node js and express. However, I have encountered persistent error messages while trying to install 'nodemon'. What type of error message am I dealing with here? How can I troubleshoot and resolve this issue? Whic ...

Continue to load additional elements using ajax in a loop until a specific element is located

I'm currently using an ajax function to continuously load the next page or results without having to refresh. It's working well, but my goal is to keep running this function in a loop until a specific element is loaded through the ajax call. Usi ...

The AJAX link to an external PHP file is not functioning correctly

A basic question with a complex issue. I am in the process of building a phonegap app that includes a section where users can input multiple emails along with a title for registration. <input type="text" name="person[]"> Afterward, Ajax comes into ...

The Ajax Process continues to run even after the user has navigated away from the page

Currently, I have a JavaScript function that refreshes a specific section of a Rails-generated view every 2.5 seconds using a JS request to update a basic progress bar. function refreshPage(){ $.ajax({ type:"GET", dataType:"script" }) } s ...

Phantom is refusing to initialize/execute angularjs controller methods

I am seeking assistance in generating a PDF file from an HTML page that is controlled by an AngularJS controller. The PDF creation process involves using the Phantom module. My issue is that while data binding works correctly when I navigate to the specifi ...

Keeping Ajax active while the PHP script is running is essential

Seeking assistance with a specific issue. I currently have an ajax script (index.php) that sends variables to a php file (thumbs.php). The php file generates thumbnail images from original files and saves them on the server. This process can sometime ...