Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
Posts: 27
Registered: ‎04-05-2011
My Device: playbook
My Carrier: moblie app developer

google map in mobile mxml project for playbook

When I use Google map in mobile mxml project for playbook , It takes several seconds (about 10s~30s) to load the view which inculde google map.
 Is it normal??

 

** when i pressed the button in view of "home"..it will hold several seconds (about 10s~30s) before go to the view of "googleMap" . and the app can't detect any action when loading to "googleMap" view.

 

the home view:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
		xmlns:s="library://ns.adobe.com/flex/spark"
		actionBarVisible="false" tabBarVisible="false" title="Home">
	<fx:Script>
		<![CDATA[
			protected function button1_clickHandler(event:MouseEvent):void
			{
				// TODO Auto-generated method stub
				this.navigator.pushView(GooglMap);
			}
		]]>
	</fx:Script>

	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
	<s:Button x="10" y="10" width="210" height="35" label="GoogleMap"
			  click="button1_clickHandler(event)"/>
</s:View>


the view inculde googe map

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
		xmlns:s="library://ns.adobe.com/flex/spark"
		xmlns:mx="library://ns.adobe.com/flex/mx"
		actionBarVisible="false" tabBarVisible="false" title="GooglMap">
	<fx:Script>
		<![CDATA[
			import com.google.maps.LatLng;
			import com.google.maps.Map;
			import com.google.maps.MapEvent;
			import com.google.maps.MapType;
			import com.google.maps.overlays.Marker;
			import com.google.maps.overlays.MarkerOptions;
			import com.google.maps.InfoWindowOptions;
			

			
			private function onMapReady(event:Event):void {
				this.map.setCenter(new LatLng(40.736072,-73.992062), 14, MapType.NORMAL_MAP_TYPE);
				var marker:Marker = new Marker(map.getCenter(), new MarkerOptions({draggable: false}));
				
				map.addOverlay(marker);
				
				marker.openInfoWindow(new InfoWindowOptions({contentHTML:"<html><body><p>ddd</p><h1>My First Heading</h1><a href='url'>Link text</a></body></html>"}));
			}

		]]>
	</fx:Script>
	
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
	<maps:Map xmlns:maps="com.google.maps.*"
			  id="map" x="317" y="10" width="643" height="434"
			  key="***************"
			  mapevent_mapready="onMapReady(event)" url="http://localhost" sensor="false"/>
</s:View>




 

 

Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: google map in mobile mxml project for playbook

hey,

 

from the threads in the past, google maps in the AIR takes a while to load (as ur estimation went). here is a thread you can use as a reference:

 

http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Google-Maps-API/m-p/662153#M1837

 

hope that clears things up. good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman