Skip to content
This repository has been archived by the owner on Nov 4, 2021. It is now read-only.

Map does not show in device (works with browser) #10

Closed
italomaia opened this issue Jun 26, 2015 · 14 comments
Closed

Map does not show in device (works with browser) #10

italomaia opened this issue Jun 26, 2015 · 14 comments

Comments

@italomaia
Copy link

I created a new project with the maps template. When I run it with ionic (ionic serve), I'm able to see the map in my browser. Running the project in my device or emulator, after installing the platform, (ionic run android or ionic emulate android) the map does not load and I get a blank screen. What could be causing this?

@kmarrero
Copy link

add google maps to your whitelist

On Fri, Jun 26, 2015 at 1:20 PM, Italo Maia notifications@github.com
wrote:

I created a new project with the maps template. When I run it with ionic
(ionic serve), I'm able to see the map in my browser. Running the project
in my device or emulator, after installing the platform, (ionic run android
or ionic emulate android) the map does not load and I get a blank screen.
What could be causing this?


Reply to this email directly or view it on GitHub
#10.

@italomaia
Copy link
Author

I have this in config.xml:

<access origin="*"/>
<allow-navigation href="*" />

And I have this in my index.html:

 <meta http-equiv="Content-Security-Policy" content="default-src 'self' *"/>

Shouldn't it be enough?

@kmarrero
Copy link

I had to put

.

The map did not show up with alone.

On Fri, Jun 26, 2015 at 2:23 PM, Italo Maia notifications@github.com
wrote:

I have this in config.xml:

And I have this in my index.html:

Shouldn't it be enough?


Reply to this email directly or view it on GitHub
#10 (comment)
.

@italomaia
Copy link
Author

<access origin="http://maps.google.com" />

Was it enough for you? I had a go and map still does not show in the device. Made a repo with my code. Could you take a look? https://github.com/italomaia/mymaps It is but a newly created project with the maps template where I added the new access rule to config.xml. I used "ionic run android" to test it on my device.

@kmarrero
Copy link

I tried this and it worked:

  1. ionic start mymap maps
  2. cd mymap
  3. cordova platform add android
  4. cordova build android

The map showed up without adding more to the whitelist than *. I seem to
have less issues with cordova builds. This assumes you installed cordova. I
typically only use ionic commands to get the starter files then switch
commands to cordova. I am using cordova 5.1.1.

On Fri, Jun 26, 2015 at 1:20 PM, Italo Maia notifications@github.com
wrote:

I created a new project with the maps template. When I run it with ionic
(ionic serve), I'm able to see the map in my browser. Running the project
in my device or emulator, after installing the platform, (ionic run android
or ionic emulate android) the map does not load and I get a blank screen.
What could be causing this?


Reply to this email directly or view it on GitHub
#10.

@italomaia
Copy link
Author

It worked! The problem was using ionic command line tool all along = (
Thanks kmarrero! Now I can sleep well again.

@italomaia italomaia reopened this Jul 1, 2015
@franzisk
Copy link

franzisk commented Sep 9, 2015

Same problem here, I have in my config.xml:

And I run:
cordova build android
cordova run android

The map is not showing in this device but in another one with Android 5.0 is showing OK, this one has Android 4.x.x

@hunkim
Copy link

hunkim commented Feb 8, 2016

Any solution? I got the same problem. It works i web browser, but not in the android/ios.

@kmarrero
Copy link

I added to my android manifest

My map had fatal error until I added this.

and to the config file

On Mon, Feb 8, 2016 at 2:42 AM, Sung Kim notifications@github.com wrote:

Any solution? I got the same problem. It works i web browser, but not in
the android/ios.


Reply to this email directly or view it on GitHub
#10 (comment)
.

@usamanoman
Copy link

Same problem....!

@kmarrero
Copy link

kmarrero commented Jan 31, 2017 via email

@errorstudent
Copy link

Hi, i have same problem, but my problem solved when i'm try to remove platform and then added again.

$ionic platform rm android
$ionic platform add android

it's work for me!

@Neseek77
Copy link

Neseek77 commented Jan 9, 2019

Adding just this

<allow-navigation href="*" />

in my app's config.xml file solved this problem for me...

@gsanjeevkumar
Copy link

everything like you all said, is allowed however the maps do not load on the Android simulator and same on phones
all text and HTML is flowing in the app right, navigation works, data from external server (JSON) is coming thru. but no images and no google maps.
let me know if you guys have any ideas.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants