Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7659335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:19:10+00:00 2026-05-31T13:19:10+00:00

I am trying to load a StageWebView with the Google Maps Javascript API inside

  • 0

I am trying to load a StageWebView with the Google Maps Javascript API inside a Flex Mobile application as a workaround for the Google Maps API for Flash not working on iOS. I am using the stageWebView.loadString() method. Below is the relevent portion of HTML.Javascript being loaded.

My issue is that everything works perfectly when I view this in a browser (IE, Chrome and Safari) and in the Flash Builder iPhone/iPad simulators. On the actual device the map never loads, and through some try..catch statements I was able to identify that I am getting “TypeError: ‘undefined’ is not a constructor” errors, which are thrown by each of the lines I listed inside the initialize function below.

Any thoughts on what may be going wrong?

  <!DOCTYPE html>
  <html>
    <head>
      <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
      <style type="text/css">
        html { height: 100% }
        body { height: 100%; margin: 0; padding: 0 }
        #map_canvas { height: 100% }
      </style>
      <script type="text/javascript"
        src="http://maps.googleapis.com/maps/api/js?v=3&key=MY_KEY&sensor=true">
      </script>
      <script type="text/javascript">
        /* a bunch of variables and functions */
        function initialize() {
          var myOptions = { center: new google.maps.LatLng(43.476302, -80.4816062), zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP };
          map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
          geocoder = new google.maps.Geocoder();
          dirDisplay = new google.maps.DirectionsRenderer();
          /* some other stuff */
        }
        if(window.addEventListener) window.addEventListener("load", initialize, true); else window.onload = initialize;
      </script>
    </head>
    <body>
      <div id="map_canvas" style="width:100%; height:100%;" ></div>
      <div id="dirPanel" style="width:100%;" ></div>
    </body>
  </html>

Edit: I checked what the google.maps object contained and was surprised to find that unlike the object appearing on browsers, with Map, Polyline, Marker, Geocoder, and a host of other child objects, the version bpresented by the iOS device looks like this:

google.maps {
  modules:Object,
  Load:function (apiLoad) { delete google.maps.Load; apiLoad([/*lots of stuff I don't feel like copying out by hand*/], loadScriptTime); },
  _gjsload_:function (name, text) { modules[name] = text; }
}

Any thoughts as to why it is different? Or what I can do about it to get the Maps API to work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:19:10+00:00Added an answer on May 31, 2026 at 1:19 pm

    Through Alexander Farber’s suggestion on this post, I decided to use MapQuest’s Flex/Flash Mobile API, which has proven to be very effective.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying to load a Bitmap onto a SWFLoader the Event.COMPLETE event is not
I'm trying to load a page that is basically an edit form inside a
so I am a total php/javascript noob. I'm trying load a full php array
Im trying to load a flash movie using swfobject which i have been successful
I am trying to load images throught javascript. Different browser than IE8 or ie9
Trying to load a local file into a webbrowser control but this does not
i am trying to load this xml file into the dropdownlist: http://sites.google.com/site/shadchanproject/Home/lots1.xml i want
I am trying load map region and MKMapView delegate methods are not being called
i'm trying to load images from Facebook Albums to my flex app, this is
I have a problem with out of memory when I'm trying load a few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.