How embed Google Maps in Flex?


Google create a special API for Flash platform to make possible use them. I will show how write a simple application to find a place or route. At first we need a special key from Google for use the map (http://code.google.com/intl/pl/apis/maps/signup.html ). When we have the key we can start.

  1. add xmlns:maps=”com.google.maps.*” to Application tag
  2. import appropriate classes
  3. add map instance
  4. <maps:Map id="myMap" width="100%" height="100%"  key="[key from the google site]" mapevent_mapready="onMapReady(event)" url="[url to our site]"/>
  5. add functions
private function onMapReady(event:MapEvent):void {
	myMap.addControl(new MapTypeControl());							//add type of map control
	myMap.addControl(new ZoomControl());							//add zoom control
	myMap.enableScrollWheelZoom();								//enable mouse scrolling
	geocoder=new ClientGeocoder();								//create geocoder
	geocoder.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, handleGeocodingSuccess);	//add listeners for geocoder
	geocoder.addEventListener(GeocodingEvent.GEOCODING_FAILURE, handleGeocodingFailure);
	dirs=new Directions();									//create directions
	dirs.addEventListener(DirectionsEvent.DIRECTIONS_SUCCESS, handleDirLoad);		//add listeners for directions
	dirs.addEventListener(DirectionsEvent.DIRECTIONS_FAILURE, handleDirFail);

}

private function handleDirLoad(evt:DirectionsEvent):void{
	var dirs:Directions=evt.directions; 							//create directions from event
	var startM:Marker;
	var endM:Marker;
	startM = new Marker(dirs.getRoute(0).startGeocode.point, new MarkerOptions());		//create start marker from directions instance
	endM = new Marker(dirs.getRoute(0).endGeocode.point, new MarkerOptions());		//create end marker from directions instance
	myMap.clearOverlays();									//clear map
	myMap.addOverlay(dirs.createPolyline());						//draw route on map
	myMap.addOverlay(startM);								//add start marker
	myMap.addOverlay(endM);									//add end marker
	myMap.setZoom(myMap.getBoundsZoomLevel(dirs.bounds));					//set appropriate zoom
	myMap.setCenter(dirs.bounds.getCenter());						//show route
}

private function handleDirFail(evt:DirectionsEvent):void{					//directions failure handler
	Alert.show("Unable to found route");
}

private function handleGeocodingSuccess(evt:GeocodingEvent):void{				//geocoding success handler
	var result:Placemark = GeocodingResponse(evt.response).placemarks[0];			//create result object
	myMap.setCenter(result.point, 14);							//show finding place
}

private function handleGeocodingFailure(evt:GeocodingEvent):void{				//geocoding failure handler
	Alert.show("Unable to found: " + evt.name);
}

This is one out of many things we can do with GoogleMaps API, including e.g. adding information and photos in concrete places on the map.

  1. #1 by hypnosis at June 22nd, 2019

    Hi there, after reading this awesome article i am also delighted to share my
    familiarity here with colleagues.

  2. #2 by free skin at June 22nd, 2019

    Well I truly enjoyed studying it. This post offered by you is very
    practical for correct planning.

  3. #3 by http://www.wolt.biz at June 24th, 2019

    I blog quite often and I really appreciate your content.
    This great article haas really peaked my interest. I am going to take a note of your blog and keep checking for new details about once pper week.

    I opted in for youjr RSS fewd too.

  4. #4 by big booty clapping at June 28th, 2019

    Do you prefer big booty latina? If yes you should decidedly navigate to BigBootyClips.com. You have never seen such a monster set of bigbooty porn in your entire life. Take a look on your own :)

  5. #5 by buy genies at June 28th, 2019

    I am no longer certain the place you’re getting your information, but great
    topic. I needs to spend a while learning much more
    or understanding more. Thank you for fantastic info I was on the lookout
    for this info for my mission.

  6. #6 by نیکا بیاتی at June 28th, 2019

    درمان‌های ارتودنسی و کاشت دهان بوسیله زیباسازی
    لبخند کمک می‌کنند و گاهی لازم است از هر دو رویه کنار روی برخی بیماران به مشیت ارامش مشکلات دندانی و
    بزمین نشستن بوسیله لبخند قشنگ استعمال
    شود. متخصصین ما تو کلینیک تخصصی ارتودنسی دکتر داودیان امکان پذیر است داخل حین درمان
    ارتودنسی از مینی اسکروها بوسیله قصد جابه‌جا
    کردن دندان‌ها و ایجاد فضای مناسب
    برای کاشت پروتز دندانی مصرف کنند، که درون این حالت خود جراحی
    کاشت در آخرین ماه‌های ارتودنسی انجام می‌شود.
    همچنین در بعضی موارد به خشکی امدن
    بن تشخیص، متخصص ارتودنسی ممکن است از مینی اسکرو یا مینی ایمپلنت برای بستن فاصله‌های کم بین دندان‌ها استعمال
    کند که در این حالت دیگر ناخوش احتیاج به ایمپلنت‌های دندانی نخواهد داشت.درمان‌های ارتودنسی
    و کاشت دندان به زیباسازی لبخند
    کمک می‌کنندکاشت دندان بهترین روش
    برای جایگزینی دندان از مشت رفته استفاده از ایمپلنت دندان در ارتودنسیکاشت دندان غالباً بهترین روش بخاطر جایگزینی دندان از دست رفته به شمار می‌آید.
    ایمپلنت دندان تو عظم فک به گونه‌ای قرار داده می‌شود تا با استخوان طبیعی جوش بخورد و پایه‌ای قرص و قوی را
    بخاطر دندان جایگزین بوسیله دست دهد.
    ایمپلنت را می‌توان جایگزین یک
    دندان کرد یا از آن به عنوان محور بریج (پل) خواه دهان جعلی دربرگیرنده چند
    دندان مصرف نمود.

  7. #7 by tutorial at June 29th, 2019

    Wow, that’s what I was seeking for, what a data! existing here at
    this webpage, thanks admin of this site.

  8. #8 by situs kiu kiu judi online terpercaya 2019 at June 29th, 2019

    When I initially commented I appear to have clicked the -Notify me
    when new comments are added- checkbox and now each time a comment is added I recieve four emails with
    the exact same comment. There has to be a means you
    are able to remove me from that service? Thank you!

  9. #9 by megahfilmeshd at June 30th, 2019

    I am no longer positive where you’re getting your information, but good topic.
    I needs to spend a while finding out more or working out more.
    Thanks for magnificent information I used to be on the lookout for
    this information for my mission.

  10. #10 by roofer at July 1st, 2019

    Good stuff, thanks for posting… ;)

  11. #11 by nasza strona at July 1st, 2019

    Thanks for a marvelous posting! I seriously enjoyed reading it,
    you may be a great author.I will make certain to bookmark your
    blog and will come back very soon. I want to encourage you to
    continue your great job, have a nice weekend!

  12. #12 by JP at July 1st, 2019

    It’s an remarkable post designed for all the internet visitors;
    they will take advantage from it I am sure.

  13. #13 by ukimmigrationattorney.com at July 1st, 2019

    Can I just say what a relief to discover someone that truly understands what
    they are talking about on the internet. You definitely realize how
    to bring a problem to light and make it important.
    More and more people have to check this out and understand this side of the story.
    I was surprised that you aren’t more popular because you most certainly have the gift.

  14. #14 by signe de la fin du monde coran at July 1st, 2019

    Ce sont des signes que le Jour du jugement est proche.

  15. #15 by seo services at July 2nd, 2019

    Good blog you’ve got here.. It’s hard to find high-quality
    writing like yours nowadays. I really appreciate people like you!
    Take care!!

  16. #16 by Famous Vastu Consultant in Chennai at July 2nd, 2019

    I’ve read some just right stuff here. Certainly worth bookmarking for revisiting.
    I surprise how much attempt you put to make this type of wonderful informative website.

  17. #17 by pervers xnx video at July 2nd, 2019

    Great post. I used to be checking constantly this blog and
    I’m impressed! Very helpful info particularly the remaining section :) I
    care for such info a lot. I used to be looking for this particular info for a very lengthy time.
    Thanks and good luck.

  18. #18 by forex at July 2nd, 2019

    Hello friends, nice piece of writing and nice urging commented at this place,
    I am actually enjoying by these.

  19. #19 by http://www.vape-wild.biz at July 5th, 2019

    My partner and I stumbled oover here from a different web page and thought I ight check things out.

    I like what I see so now i’m following you. Look forward to checking
    out your web page repeatedly.

  20. #20 by forex at July 5th, 2019

    What i do not realize is in reality how you’re no longer really a
    lot more neatly-liked than you may be right
    now. You’re very intelligent. You recognize therefore considerably in the case of this matter,
    made me for my part imagine it from numerous numerous angles.
    Its like women and men aren’t involved unless it’s
    something to accomplish with Woman gaga! Your individual
    stuffs nice. Always take care of it up!

  21. #21 by website at July 6th, 2019

    What’s up friends, good post and pleasant urging commented at this place,
    I am truly enjoying by these.

  22. #22 by work from home at July 7th, 2019

    Hi there very nice web site!! Guy .. Excellent ..
    Superb .. I will bookmark your web site and take the feeds also?
    I’m glad to search out a lot of helpful information right here within the post, we
    want develop more strategies in this regard, thank you for sharing.

    . . . . .

  23. #23 by and also the end merchandise is a marvellous dinner that you could offer others. The following tips can provide a begin toward becoming an outstanding prepare food.|Foods are such an essential part in our lives. {{Cooking|Cooking food|Food preparation|Pre at July 8th, 2019

    Valuable information. Fortunate me I found youjr
    site unintentionally, and I am shoced why this accident didn’t took place earlier!
    I bookmarked it.

  24. #24 by rental tanaman at July 8th, 2019

    This blog was… how do you say it? Relevant!!

    Finally I have found something which helped me. Kudos!

  25. #25 by http://www.clikd.co at July 8th, 2019

    fantasric issues altogether, you simply won a brand new reader.
    What could you suggest in regards to your put uup that yoou made a
    few days ago? Any positive?

  26. #26 by filmeseseries at July 9th, 2019

    It is in point of fact a nice and helpful piece of information.
    I’m happy that you shared this useful info with us.
    Please stay us up to date like this. Thanks for sharing.

  27. #27 by Nike Günstig Kaufen at July 11th, 2019

    Very rapidly this site will be famous ammong all blogging people, due to
    it’s fastidious articles or reviews

  28. #28 by dat nuoc phap at July 12th, 2019

    obviously like your website but you need to test the spelling on quite a few of your
    posts. A number of them are rife with spelling problems and I find it very troublesome to tell the reality then again I’ll definitely come back again.

  29. #29 by 인터넷설치 at July 12th, 2019

    Excellent web site you’ve got here.. It’s hard to find high
    quality writing like yours nowadays. I seriously appreciate people like you!
    Take care!!

  30. #30 by free fuck x video at July 12th, 2019

    Please let me know if you’re looking for a author for your blog.
    You have some really great posts and I believe I would be a good asset.
    If you ever want to take some of the load off, I’d love to write some articles for your
    blog in exchange for a link back to mine. Please send me an e-mail if
    interested. Thanks!

  31. #31 by blog at July 13th, 2019

    Fabulous, what a web site it is! This web site presents helpful facts to us, keep it up.

  32. #32 by toko material at July 15th, 2019

    This post provides clear idea for the new users of blogging, that genuinely how to do blogging and
    site-building.

  33. #33 by website at July 16th, 2019

    Your style is very unique compared to other folks I have read stuff from.
    Thank you for posting when you have the opportunity, Guess I’ll just book mark this blog.

  34. #34 by kids helping at July 16th, 2019

    Have you ever thought about creating an e-book or
    guest authoring on other websites? I have a blog based upon on the same ideas you discuss and would love to have you share some stories/information. I know my visitors would value
    your work. If you’re even remotely interested, feel free to send
    me an e mail.

  35. #35 by address at July 17th, 2019

    In particular, you’ll find 3-reel, 5-reel,multi-reel slots, progressive jackpot
    and video slot machine games, through wjich maximum win can reach countless dollars.
    These skilled poker players will certainly provide you with very best information and they will prove
    supportive to yoou in your bankroll management. If you are a
    basketball lover, you can play Slam Dunk or 3 Point Hoops.

  36. #36 by www at July 17th, 2019

    Do you have a spam problem on this blog; I also am a blogger, and
    I was wondering your situation; many of us have developed some nice practices and we
    are looking to exchange techniques with others,
    why not shoot me an e-mail if interested.

  37. #37 by super chutes at July 17th, 2019

    Hello, its pleasant piece of writing concerning media print,
    we all be aware of media is a enormous source of information.

  38. #38 by 파라다이스 호텔 카지노 at July 17th, 2019

    What i do not understood is if truth be told how you
    are now not really much more well-liked than you might be now.
    You’re so intelligent. You understand therefore significantly in terms of this
    matter, produced me personally consider it from numerous numerous angles.
    Its like women and men don’t seem to be fascinated except it’s
    something to accomplish with Lady gaga! Your personal stuffs nice.
    Always maintain it up!

  39. #39 by www at July 18th, 2019

    This web site really has all the info I needed about this subject and didn’t know who to ask.

  40. #40 by razor electric scooter e100 at July 18th, 2019

    The the lubrastrip that is enhanced, as Gillette likes
    to call it, makes the Fusion Proglide glide smoothly and easily on skin. As a matter of
    fact, in regards to choosing depending on the name, the choice is quite easy because Gillette
    is a manufacturer. Razor is a famous manufacturer that provides scooters for adults and youngsters alike.
    Some of the most frequent variables are price, layout, specialized or manufacturer
    aspects – such as the amount of blades it’s along with also the capacity to secure you a close shave, without causing
    bumps, burns or nicks. Since they are instant to causing nicks and cuts which result in skin irritation do not opt for the cheap disposable razor.
    Most of the safety razors are double-edged, this way you’re ready
    to utilize both sides of the razor before throwing it off.

    The Tinkle is so cheap, is utilized dry, so you don’t need to utilize any shaving
    lotion or lotion, the blade is designed to prevent you it’s really easy
    to use and fast, and painless.

  41. #41 by labeled window at July 18th, 2019

    There is visibly a bundle to identify about this. I consider you
    made various nice points in features also.

  42. #42 by гадания at July 18th, 2019

    Thanks , I have just ƅeen searching for inf᧐ about this subject for a while and yours is
    the greatest I have discovered tilⅼ now. But, what
    about the conclսsion? Are you sure about the source?

  43. #43 by sewa bus vip surabaya at July 20th, 2019

    I believe everything said made a lot of sense.
    However, what about this? what if you wrote a catchier post
    title? I ain’t saying your information isn’t good., but suppose you
    added something that grabbed a person’s attention?
    I mean How embed Google Maps in Flex? « RIAfreaks is a little vanilla.
    You might glance at Yahoo’s home page and note how they create article headlines to grab people to click.
    You might add a video or a related picture or two to grab readers interested about what you’ve written. In my opinion, it
    might make your website a little bit more interesting.

  44. #44 by http://monzilfoods.com at July 20th, 2019

    As long as you’re trying to improve, your man will appreciatfe the effort.
    Yes lubricant has been shown to bring effective relief
    for the following conditions:. Male condoms: It is
    composed of latex or polyurethane and is rolled on the erect penis.

  45. #45 by ดูอนิเมะออนไลน์ at July 24th, 2019

    You actually make it appear so easy with your presentation however I find this topic to
    be actually something that I believe I would never understand.
    It seems too complex and very huge for me. I am having
    a look forward on your next submit, I’ll attempt to get the hold of it!

  46. #46 by www.elron.co at July 24th, 2019

    Hey there! Someone in myy Myspace group shared this site with us sso I
    came too look it over. I’m definitely loving thhe information.
    I’m book-marking and will be tweeting this to my followers!
    Superb blog and excellent design and style.

  47. #47 by big yellow booty at July 25th, 2019

    Do you select big booty bitches? If yes you should decidedly check BigBootyClips.com. You have never seen such a monster selection of bigbooty porn in your entire life. Take a look on your own :)

  48. #48 by Eula at July 25th, 2019

    The answers to these questions plays a role in developing your style at
    online poker and sustaining your technique to be successful.
    Chat around with the other players in the space and inquire concerns about
    their fulfillment. A player getting 3 pairs in cards at hand ought to location the greatest
    pair in second set of two cards. Check out at least
    3 tables before you begin.

  49. #49 by Grünen Tee informationen at July 25th, 2019

    Schoene Webseite, ich komme sicher mal wieder vorbei.

  50. #50 by Everette at July 26th, 2019

    The broad spectrum of dances includes contemporary,
    classical, ballroom, street, jazz, hip-hop, musical theatre and all
    of their sub-genres. Ouija Boards have been about for a long time, nevertheless
    they are still being confused for some some
    sort of portala communication devise thhat alows us to speak with our passd husehold
    or spirits we don. The theater was built by Torbay Council inn its complete redevelopment of Princess Gardens and
    Princess Pier.

(will not be published)