Google Maps API: GDirections with no Markers

I’ve been working with the Google Maps API quite a lot over the past couple of weeks, but one thing that has continuously thwarted me, has been how to remove the little Info Window maps from a route that has been loaded using GDirections and finally I have found the answer. When you load a GDirections object with the optional map panel in the constructor it automatically places the route and markers on the map. The work around is to not provide any arguments to the constructor, and instead load retrieve the GPolyline with the getPolyline method and the getPolyline: true option. Then in the “load” event, add it to the map and presto.


var dirs = new GDirections();
GEvent.addListener(dirs, "load", function() {
var polyline = dirs.getPolyline();
map.addOverlay(polyline);
});
dirs.loadFromWaypoints("Directions from here to there", {getPolyline: true});

20,628 thoughts on “Google Maps API: GDirections with no Markers

  1. Excellent post. I was checking continuously this blog and I am
    impressed! Extremely helpful info particularly the last part 🙂 I care for such information much.
    I was seeking this certain information for a long time.

    Thank you and good luck.

  2. Heya i am for the primary time here. I came across this board
    and I to find It truly helpful & it helped me out much.
    I’m hoping to provide one thing back and aid others like you
    helped me.

  3. I’m impressed, I must say. Rarely do I come across a blog that’s equally educative and entertaining, and without a doubt, you have hit the nail on the head.
    The issue is something not enough people are speaking intelligently about.
    I am very happy that I found this during my hunt for
    something relating to this.

  4. I think the admin of this website is actually working hard in favor of his web page, since here
    every information is quality based information.

  5. I think this is among the most important information for me.
    And i am glad reading your article. But want to remark on few general things, The website style is perfect,
    the articles is really great : D. Good job, cheers

  6. Howdy! This blog post couldn’t be written any better! Reading through this post reminds me of my previous roommate! He always kept talking about this. I’ll forward this post to him. Pretty sure he’ll have a very good read. Many thanks for sharing!

  7. Its such as you learn my thoughts! You appear to know a lot approximately this, like you wrote the ebook in it or
    something. I think that you could do with some % to drive
    the message home a bit, but instead of that, that is fantastic
    blog. An excellent read. I’ll definitely be
    back.

  8. hello there and thank you for your info – I’ve certainly picked up anything new from
    right here. I did however expertise a few technical points using this web site, as I experienced to reload the
    site many times previous to I could get it to load correctly.
    I had been wondering if your web host is OK? Not that I am complaining, but sluggish loading instances times
    will often affect your placement in google and could damage
    your high-quality score if ads and marketing with Adwords.

    Anyway I’m adding this RSS to my e-mail and could look out for much more of your respective exciting content.
    Make sure you update this again soon.

  9. I really like what you guys tend to be up too. This kind of clever work and reporting!

    Keep up the terrific works guys I’ve added you guys to my blogroll.

  10. Thanks on your marvelous posting! I genuinely enjoyed reading it, you’re a great
    author. I will make sure to bookmark your blog and will often come back later on. I
    want to encourage you to continue your great job, have a nice evening!

  11. Wonderful blog! I found it while surfing around on Yahoo News.

    Do you have any tips on how to get listed in Yahoo News?
    I’ve been trying for a while but I never seem to get there!
    Appreciate it

  12. I blog often and I really thank you for your information. This article has really peaked my interest. I am going to take a note of your website and keep checking for new information about once a week. I opted in for your Feed as well.

  13. Heya i’m for the first time here. I came across this board and I find It truly useful & it helped me out much.
    I hope to give something back and help others like you aided me.

  14. It’s a shame you don’t have a donate button! I’d without a doubt donate to this brilliant
    blog! I suppose for now i’ll settle for bookmarking and
    adding your RSS feed to my Google account. I look
    forward to fresh updates and will share this site with my Facebook group.
    Chat soon!

  15. Yesterday, while I was at work, my sister stole my iphone and tested to see if it can survive
    a twenty five foot drop, just so she can be a youtube
    sensation. My apple ipad is now broken and she has 83 views.
    I know this is entirely off topic but I had to share it with
    someone!

  16. Hello i am kavin, its my first time to commenting anywhere, when i read this article i thought i could also make comment due to this brilliant paragraph.

  17. Hi this is kinda of off topic but I was wondering if blogs
    use WYSIWYG editors or if you have to manually code
    with HTML. I’m starting a blog soon but have no coding know-how so I wanted to get guidance
    from someone with experience. Any help would be greatly appreciated!

  18. Simply desire to say your article is as astounding.

    The clearness in your post is simply spectacular and i can assume you are an expert on this subject.

    Well with your permission let me to grab your RSS feed to keep up
    to date with forthcoming post. Thanks a million and please continue the gratifying work.

  19. Nice post. I learn something new and challenging on blogs I stumbleupon everyday.
    It’s always useful to read articles from other writers and practice
    something from other websites.

  20. I delight in, result in I discovered exactly what I was having a look for.

    You have ended my 4 day long hunt! God Bless you man. Have a nice day.
    Bye

  21. Good blog you’ve got here.. It’s difficult to find quality writing like yours nowadays.
    I honestly appreciate people like you! Take care!!

  22. I am not certain the place you’re getting your information, but
    good topic. I needs to spend some time learning more or working out more.

    Thank you for excellent information I was in search of this information for my
    mission.

  23. Awesome blog! Do you have any suggestions for aspiring
    writers? I’m planning to start my own site soon but I’m a little lost on everything.

    Would you advise starting with a free platform like WordPress or go for a paid option?
    There are so many choices out there that I’m
    totally confused .. Any recommendations? Thanks a lot!

  24. Hola! I’ve been reading your website for some time now and finally
    got the courage to go ahead and give you a shout
    out from Kingwood Tx! Just wanted to mention keep up the great work!

  25. Have you ever considered publishing an e-book or guest authoring on other websites?
    I have a blog based on the same information you
    discuss and would really like to have you share some stories/information. I know
    my subscribers would enjoy your work. If
    you are even remotely interested, feel free to send me an e mail.

  26. I’ve read several just right stuff here. Certainly value
    bookmarking for revisiting. I wonder how so much attempt you place to create one of these excellent informative website.

  27. We stumbled over here coming from a different page and thought I may as well check things out.
    I like what I see so now i am following you. Look forward to looking at your web page again.

  28. Spot on with this write-up, I truly believe this web site needs far more attention. I’ll
    probably be back again to read more, thanks for the advice!

  29. I loved as much as you will receive carried out right here.
    The sketch is attractive, your authored subject matter stylish.
    nonetheless, you command get got an edginess over that you wish be delivering the following.
    unwell unquestionably come further formerly again since exactly the same nearly
    very often inside case you shield this increase.

  30. Yesterday,while I wwas at work, my sister stole my iPad and tested to see if it
    can survive a forty foot drop, just sso she can be
    a youtube sensation. My apple ipad is now broken and she has 83 views.

    I know tyis is tootally off topic buut I had tto share it
    with someone!

    My web page … TheIndianTimes

Leave a Reply

Your email address will not be published. Required fields are marked *