KML file lines showing incorrect colors

Home Forums MapPress Support KML file lines showing incorrect colors

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #21597
    joew
    Participant

      KML files and mappress.

      When I look at this KML file in Google Earth, I see one color for the line file. https://earth.google.com/earth/d/1Up-EZGfZlNY5BMPEJWcj4GAePsO2QPGx?usp=sharing

      But when I upload to this website and look, I see only a blue color. All my KML files appear to show this color. https://piedmontal.wpenginepowered.com/terrapin-creek/

      Any ideas on what could be causing this? An issue with the KML file that’s being created? Thanks for the help!

      #21598
      joew
      Participant

        By the way, I’m using Mapbox instead of google maps. Not sure if that has anything to do with it.

        #21600
        Chris
        Keymaster

          Hi Joe,

          The Omnivore KML plugin for Leaflet is used to display KMLs when using Leaflet (and Mapbox), and it only displays blue lines. If you want to change the color of all lines (and not per-line), I’ll see if I can find a workaround for you, but it’ll take some code as it’s not supported by default.

          You also have the option of using Google, which does support line colors.

          #21606
          Chris
          Keymaster

            Hi,

            I looked more closely at the KML file on your site and I think it won’t display the right color line in Google Maps either. I’m not a KML expert, but I think there’s some incompatibility between Google Earth projects exported as KML and the Google Maps API. It’s something to do with the StyleMap tag. Google has several issues for this in their bug tracker. For example:
            https://issuetracker.google.com/issues/35816676

            If you’d like to email me directly, I’ll respond with a “corrected” version of the file that displays as a red line.

            Also, I’ve updated MapPress to make the Omnivore plugin display the correct line colors when using Leaflet. If you’d like to try the new version please let me know.

            #21609
            joew
            Participant

              I’d love to try to make it work with Mapbox/Leaflet. I hate google maps. I’ve had to pay too many times for even Mapbox, but google maps is just way to pricey! I did change out to Google maps and it seems to at least somewhat work in that format, but other things seem off. Thanks!

              #21610
              joew
              Participant

                I’ve been working a bit more on this. Below is a mashup of three different KML oriented maps, along with around 50 points of interest. One KML is a paved bike path around 40 miles long, one KML is a hiking trail around 160 miles long, and the third is a kayak trail just a few miles long. I’d love to be able to display them as three separate colors to better differentiate them. Any suggestions or help you can provide would be greatly appreciated. Still using Mapbox, as google maps wasn’t really working out all that well.

                By the way, I’ve been using mappress for longer than any other plugin (for sure 10+ years) and it has always been stellar–and you’ve always been so helpful. I really appreciate it!

                Joe

                https://piedmontal.wpenginepowered.com/1657-2/

                #21614
                Chris
                Keymaster

                  Hi Joe,

                  Could you reach out to me via email or the contact form? I’d like to get a temporary admin login so I can install the latest version, and I’ll provide the edited KML in case it’s helpful.

                  The plugin should display the right colors in Leaflet – but only if the KML is valid. As I mentioned before, Google Earth KMLs don’t always seem to work, so you might need to use a different tool to create the KMLs.

                Viewing 7 posts - 1 through 7 (of 7 total)
                • You must be logged in to reply to this topic.