Software Archive
Read-only legacy content

Google maps.

nicolas_r_
Beginner
3,459 Views

Hi i have the next code:
 

 <body>
    <div id="map" style="width: 500px; height: 400px;"></div>
    <script>
var map;
function initMap() {
  map = new google.maps.Map(document.getElementById('map'), {
    center: {lat: -34.397, lng: 150.644},
    zoom: 8
  });
}
 </script>
    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
        async defer></script>
  </body>
</html>

 

i Use my api key the problem tath i have is the page where the map load, load full grey and i have to rotate the screen to fix tath 

0 Kudos
14 Replies
Amrita_C_Intel
Employee
3,459 Views

Hello Nicolas,

Which XDK version are you using?

Which device are you testing on?

I would recommend you trying this sample app and test the behaviour of the maps. Here is the sample

https://github.com/gomobile/sample-html5-geolocation-map

You can access this sample directly from XDK under samples and demos.

0 Kudos
Anusha_M_Intel1
Employee
3,459 Views

You mean rotating the screen fixes the map display?

0 Kudos
nicolas_r_
Beginner
3,459 Views

Amrita C 
how i add this to my app i tried once and it dint work 

im using last version of intel xdk, i tried with all the devices from the emulator and with sony xperia c3 and samsung galaxy s3 on real

Anusha M
yes rotating the screen it fiexed 

 

 

 

0 Kudos
Amrita_C_Intel
Employee
3,459 Views

Hi Nicolas,

You have to create a new project of that particular sample, name it and check in the plugin from the core list. And test that out if map is working or not.

0 Kudos
nicolas_r_
Beginner
3,459 Views

Amrita C. (Intel)  
the problem tath i have is i don't need the geo part of the sample so when i try to removed everythink crash tath why i would like to fix the simple example tath google maps bring.

0 Kudos
Amrita_C_Intel
Employee
3,459 Views

Ok! Which XDK version are you using? Building for which platform? (iOS, Android, crosswalk, windows)

0 Kudos
nicolas_r_
Beginner
3,459 Views

i use the last one (2807) and i want to build for android and ios. whit ui framework jquery mobile

0 Kudos
Amrita_C_Intel
Employee
3,459 Views

Ok! Can you IM me .zip file of the project?

0 Kudos
nicolas_r_
Beginner
3,459 Views

to wich email? i have mac can i send just the folder?

0 Kudos
Amrita_C_Intel
Employee
3,459 Views

 

Steps to create .zip project:

  1. Locate the items to zip in the Mac Finder (file system)
  2. Right-click on a file, folder, or files you want to zip.
  3. Select “Compress Items”
  4. Find the newly created .zip archive in the same directory.
In the comment section you can see send author a message. you can send the .zip file through that.
    0 Kudos
    nicolas_r_
    Beginner
    3,459 Views

    ready the file.

    0 Kudos
    Amrita_C_Intel
    Employee
    3,459 Views

    Now you can send me.

    0 Kudos
    nicolas_r_
    Beginner
    3,459 Views

    did you receive the message ?

    0 Kudos
    Amrita_C_Intel
    Employee
    3,459 Views

    Yes replied you!

    0 Kudos
    Reply