Google My Maps - Too many layers? - Here's how to merge them

General urban exploration stuff -- location specific stuff in the categories below
Post Reply
User avatar
SubLunar
500+ Poster
500+ Poster
Posts: 13619
Joined: Sat Apr 14, 2007 1:41 pm
Location: St. Louis

Google My Maps - Too many layers? - Here's how to merge them

Post by SubLunar »

To start off with:

Fuck you to whomever makes mymaps such a klunky piece of shit. I fucking hate using it. And all the people commenting useless bullshit in help forums on this topic can also eat shit.

-

I've struggled for years with having "too many layers" in mymaps. When I originally created.. ahem ..MY mymap, I decided organization via layers was the way to go. Unfortunately, I soon hit the layer ceiling (which I believe is 10). Which means when I find new maps of interesting things online, I can't just import them to my master map. Undoing this mistake has been a mindblowingly frustrating experience. In order to reduce layers and consume/assimilate all the maps and points of interests I can find on the internet, I've wasted hours of my life trying to merge the layers using a variety of methods.

Maybe I'm just an idiot, considering that I just realized today how easy it is to do it manually.

THE PROBLEM:

When I tried to move the placemarks from one layer to another from within mymaps itself, I get about 5-10 moved before mymaps crashes. EVERY FUCKING TIME on EVERY COMPUTER. So I then hit the error message > Reload link it generates and find that most of the ones I moved didn't get saved. FfffFFFffuuuuckkk. It's the most klunky fucking thing ever. It takes forever and crashes and loses all your work. Fuck you, google.

Googling solutions for this problem results in unnecessarily convoluted bullshit like this which doesn't work:
https://gis.stackexchange.com/questions ... oogle-maps

I wasted a bunch of time with online tools that automatically merge kml's for you. But they seem to lose the icon styles/colors and default everything to blue. It'd take a LONG fucking time to redo all the individual placemark icons. Fuck that.
https://kmlmerger.com/

-

I've tried digging into this off and on for years, usually giving up out of frustration. Again, maybe I'm just stupid. At any rate, finally today I was stuck in a day-long work class and decided I would tackle this problem again.

THE SOLUTION:


What I discovered/realized is that KML files are just XML files. And each layer is simply a "folder". Which means...

All you have to do is modify the code to remove the separate folders and thus contain all the placemarks within WHATEVER FUCKING LAYER(\FOLDER) YOU WANT THEM IN. VOILA. Depending on your ability to CTRL+F and search through XML code, this takes mere SECONDS.

It's EASY AS FUCK.

So here's what you do:

Download your KML file. Make a copy of it because you're a dumbass who will probably overwrite the original and then reupload it or something stupid. Change the file extension to XML. Open it with Notepad++

The top part of the XML file contains a bunch of (apparently useless) information. The important stuff starts with the first <Folder> tag. In my case, this is generally around line # 3593. Simply CTRL+F and search for <Folder>. That's your first layer. It should be just below the </StyleMap> tag. Just look at the tag above it and verify it's just below the </StyleMap> tag.

Now if you're trying to merge X number of layers into one, then consider the first layer to be your main layer going forward. So what you'll want to do is find the end of this layer(/folder). This is simple. Search for the </Folder> end tag. This is the end of your first layer(/folder). Here's an example snippet of code.

</Placemark>
</Folder>
<Folder>
<name>Layer 2</name>
<Placemark>
All you gotta do is DELETE the tags between the placemarks at every layer(/folder) that you're wanting to remove in your code like so. The objective is making all your placemarks exist in the same folder. Each placemark is, obviosuly, a location on your map. So the above code snippet should look like this:

</Placemark>
<Placemark>
The very end of your code should look like something like this. Simply note that there's very little code here. There's the end of your last placemark, the </Folder> end tag and the document and kml closing tags. If you have only one <Folder> start tag at the top (directly under </StyleMap> tag) and one </Folder> end tag at the bottom like this, then you have one layer in your map. Success.

</Placemark>
</Folder>
</Document>
</kml>

When you're done, just change the extension back to KML and upload. Create a new mymap to test/verify.

If you're merging X number of layers into one, then you should only have ONE <Folder> start tag at the top and one </Folder> end tag at the bottom and that's it. If you want more layers, just make sure you have both start and end folder tags to contain them. All you gotta do is realize that the <Folder> tags designate your layers start point and </Folder> designates your layer end point.

By doing this, you also RETAIN ALL of your icons/colors/etc.

I have NO FUCKING IDEA why this information isn't posted elsewhere on the internet, or why all the online mergers/etc that I've tried totally erase all the icon/color settings when it's this EASY to do it correctly and RETAIN ALL OF THAT SHIT.

I've tested this on various map KML files of mine and I've found that the (apparently useless) header information makes literally no impact on any of my maps. Cutting and pasting the content of the <Folder></Folder> tags (and all placemarks contained therein) WORKS FINE across any of my maps. I can cut and paste all my maps together however the fuck I want. It works.
User avatar
gnar_hesh
0-99 Poster
0-99 Poster
Posts: 75
Joined: Sat Jan 09, 2021 2:09 pm
Location: St. Louis

Re: Google My Maps - Too many layers? - Here's how to merge them

Post by gnar_hesh »

Solid intel. Thanks man.
Would you like to know more?


IG:@Gnarlord_of_the_Wasteland
User avatar
Nicotti
The Awkward Ninja
The Awkward Ninja
Posts: 11003
Joined: Thu Aug 24, 2006 7:46 pm

Re: Google My Maps - Too many layers? - Here's how to merge them

Post by Nicotti »

Just drop a couple thou on a copy of ArcGIS and create as many map layers as you want.
More online investigation than onsite exploration these days.

“My dear fellow, who will let you?”
“That’s not the point. The point is, who will stop me?”
-Ayn Rand
User avatar
Snoopy
0-99 Poster
0-99 Poster
Posts: 66
Joined: Sun Oct 16, 2016 10:34 am

Re: Google My Maps - Too many layers? - Here's how to merge them

Post by Snoopy »

I've been struggling with that same issue for years. Thank you for doing the legwork sub <3
User avatar
UntamedMainer
0-99 Poster
0-99 Poster
Posts: 1
Joined: Fri Mar 10, 2023 12:14 pm

Re: Google My Maps - Too many layers? - Here's how to merge them

Post by UntamedMainer »

I just created an account on here so I can thank you...Holy shit, this problem has been frustrating the hell out of me for so long and I found you via a Google search after finding TONS of bullshit "solutions" as you stated. I love your post from start to finish, it made me laugh, and I completely share your sentiment on mymaps...total clunky piece of shit. I can't believe it was created by Google.

My problem was importing a hiking trail that came through in four separate folders. Your solution worked perfectly, combining all of the paths into a single layer, but it still had 4 paths in the layer, and I wanted a single path. Easy fix thanks to your help. I just cut/pasted the coordinates into one line, deleted the extra code, and viola, one path in one folder. Clean and beautiful.

I also love your recommendation to make a copy of the original...yes, I've been that dumbass before. Excellent advice.

I can't thank you enough for saving me from this endless frustration, you made my day, and are a genius among a sea of morons with bullshit "solutions."

Much appreciated!

Angela
User avatar
SubLunar
500+ Poster
500+ Poster
Posts: 13619
Joined: Sat Apr 14, 2007 1:41 pm
Location: St. Louis

Re: Google My Maps - Too many layers? - Here's how to merge them

Post by SubLunar »

UntamedMainer wrote: Fri Mar 10, 2023 12:50 pm I just created an account on here so I can thank you...Holy shit, this problem has been frustrating the hell out of me for so long and I found you via a Google search after finding TONS of bullshit "solutions" as you stated. I love your post from start to finish, it made me laugh, and I completely share your sentiment on mymaps...total clunky piece of shit. I can't believe it was created by Google.

My problem was importing a hiking trail that came through in four separate folders. Your solution worked perfectly, combining all of the paths into a single layer, but it still had 4 paths in the layer, and I wanted a single path. Easy fix thanks to your help. I just cut/pasted the coordinates into one line, deleted the extra code, and viola, one path in one folder. Clean and beautiful.

I also love your recommendation to make a copy of the original...yes, I've been that dumbass before. Excellent advice.

I can't thank you enough for saving me from this endless frustration, you made my day, and are a genius among a sea of morons with bullshit "solutions."

Much appreciated!

Angela
YAY! That's awesome to hear.

So glad I could help!
Post Reply