Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

experiment with coloured/styled markers #2

Open
harry-wood opened this issue Mar 13, 2017 · 2 comments
Open

experiment with coloured/styled markers #2

harry-wood opened this issue Mar 13, 2017 · 2 comments

Comments

@harry-wood
Copy link
Owner

There's probably a way to influence colour/style of markers displayed by MAPS.ME for the KML placemarks. (Anyone know?)

Could be used to make notes maybe a bit less prominent

Could be used to highlight different types of notes. What would be useful? different colour for old ones? ones with more discussion? ones which mention the word "survey"?

@dobratzp
Copy link

Personally, I use various colors for my personal bookmark lists in Maps.me and it would be handy to be able to have this tool generate a KML file with a color of my choice.

After some experimenting with emailing myself an exported bookmarks list from Maps.me on iOS, it looks to be possible to change the color of the icons. You just need a <styleUrl> element between <description> and <Point> in the KML file. Something like this:

  <Placemark>
    <name>Some Note</name>
    <description><![CDATA[some stuff missing from OSM]]></description>
    <styleUrl>#placemark-purple</styleUrl>
    <Point><coordinates>-5.47162,56.41488</coordinates></Point>
  </Placemark>

It looks like Maps.me recognizes the following values for <styleUrl>:

  • #placemark-red
  • #placemark-yellow
  • #placemark-blue
  • #placemark-green
  • #placemark-purple
  • #placemark-orange
  • #placemark-brown
  • #placemark-pink
  • #placemark-hotel

Without a <styleUrl>, it looks to be defaulting to #placemark-red.

In the exported KML file, the first child elements of <Document> are a bunch of <Style> elements, but those don't need to be present in the imported KML for Maps.me to honor the <styleUrl> elements inside the placemarks. For reference, this is the code that is inserted directly under <Document> (there is no entry for #placemark-hotel):

  <Style id="placemark-blue">
    <IconStyle>
      <Icon>
        <href>http://mapswith.me/placemarks/placemark-blue.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Style id="placemark-brown">
    <IconStyle>
      <Icon>
        <href>http://mapswith.me/placemarks/placemark-brown.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Style id="placemark-green">
    <IconStyle>
      <Icon>
        <href>http://mapswith.me/placemarks/placemark-green.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Style id="placemark-orange">
    <IconStyle>
      <Icon>
        <href>http://mapswith.me/placemarks/placemark-orange.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Style id="placemark-pink">
    <IconStyle>
      <Icon>
        <href>http://mapswith.me/placemarks/placemark-pink.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Style id="placemark-purple">
    <IconStyle>
      <Icon>
        <href>http://mapswith.me/placemarks/placemark-purple.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Style id="placemark-red">
    <IconStyle>
      <Icon>
        <href>http://mapswith.me/placemarks/placemark-red.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Style id="placemark-yellow">
    <IconStyle>
      <Icon>
        <href>http://mapswith.me/placemarks/placemark-yellow.png</href>
      </Icon>
    </IconStyle>
  </Style>

@harry-wood
Copy link
Owner Author

harry-wood commented Mar 27, 2017

Thanks @dobratzp . yes <styleUrl> works!

purple-note-bookmarks

I've added this, so far just as a hidden feature. So now if you start from a URL like this: https://harrywood.co.uk/maps/notes/kml/?colour=purple They'll be purple. You can choose one of those colours for all your notes.

That's with this commit:
cf75365#diff-68033d70f2453b29f589380f865c585cR76

So now we need a "settings" bit within the interface to set that param. And I want to try making it do "colour schemes" such as red-orange-yellow for different aged notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants