Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6152679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:57:43+00:00 2026-05-23T19:57:43+00:00

I am new to Google Maps, so I have most likely missed something very

  • 0

I am new to Google Maps, so I have most likely missed something very basic. I want to group several lines, way points, locations .. logically together, so that I can switch them on / off at once. I thought this is a layer or overlay, but I am still confused about the difference.

On Playground I found the traffic overlay example which is basically doing what I want to do. But what kind of overlay is right for me? And how will draw the line to a particular overlay?

A similar question Google Maps marker grouping is doing this by categories on the marker and more or less iterating through them to switch
them on/off – is there no easier way?

I could, of course, keep all elements (lines, markers) of a group in an array and this array would represent my logical group. Is this the right way?

var path = waypointsToLatLngPath(myWaypoints); // generate path from waypoint
var line = new google.maps.Polyline({
    path: path,
    strokeColor: '#ff0000',
    strokeOpacity: 1.0,
    strokeWeight: 1
});
line.setMap(map);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:57:44+00:00Added an answer on May 23, 2026 at 7:57 pm

    As said in Google Maps API v3: How to remove all markers? and in my comment above, with V3 the right approach seems to be to keep arrays of the overlay elements and remove them by setting map to null.

    I have written a little JS “class” for wrapping these aspects, so I can easily switch on/off all overlays. In V2 there was map.clearOverlays(), but this seems to be gone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a map object lile var map = new google.maps.Map(document.getElementById(map_canvas),myOptions); and I want
I have this block of code inside a loop: var points = [new google.maps.LatLng(lat1,
I am using the new Google Maps v3 STYLED MAP. I want to change
I am working my way through the Google Maps API and have the following
I am new to Google Maps. I have a Google Maps v3 map added
I have drawn circle using circle = new google.maps.Circle({ map: map, radius: r, //
I have this function that adds the new marker to the google maps. But
I have this javascript, if ( $.cookie(latlng) ) { myLatlng = new google.maps.LatLng( $.cookie(latlng)
I'm testing the new Symbols object of the Google Maps V3 API. I have
I have a Google Maps project, and I want to do an array to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.