Jump to content
TNG Community

Pins Colour at Event Map


747

Recommended Posts

Is it possible to set Pins Colour at Event Map depending on the Event Type? For example, Orange for Married, Brown for Buried, Green for Military and so on. May be a mod exists?
Many thanks for an advice.

Link to comment
Share on other sites

Setting of colours I’ve edited at line 433 in file personlib.php. There I insert about 20 new rows (for different Event Types) with text such these:

      //Colour depending on the Event Type

      if($data['text']=='Died') $pinplacelevel='184';

      if($data['text']=='Born') $pinplacelevel='054';

      if($data['text']=='Married') $pinplacelevel='010';

Text I copied from the Event map – see attachment.

Unfortunately, I cannot it arrange better to make it work in multiple languages.

PinsColour.gif

Link to comment
Share on other sites

Since pin colors on the Event Map are assigned based on the Place Level definitions, you might be able exploit that capability and use either the Google Maps - More Place Levels or Google maps 15 mod to set your place levels for specific on event types. 

You would get the advantage of showing the Pin Legend which in your map is not showing since no placelevel have been assigned and also get the legend in language used to display the page.

Link to comment
Share on other sites

  • 4 months later...

Wouldn't something like the following make it language independent, at least for the standard events?

if($data['text']==$text['born']) $pinplacelevel='054';
if($data['text']==$text['married']) $pinplacelevel='010';
if($data['text']==$text['died']) $pinplacelevel='184';

To make your key, instead of doing the loop, you could do another list.  Something like:

$persontext .= "<img src=\"{$cms['tngpath']}img/054.png\" alt=\"{$text['born']}\" height=\"17\" width=\"10\" class=\"alignmiddle\"/>&nbsp;: " . $text['born'] . " &nbsp;&nbsp;&nbsp;&nbsp;\n";
$persontext .= "<img src=\"{$cms['tngpath']}img/010.png\" alt=\"{$text['married']}\" height=\"17\" width=\"10\" class=\"alignmiddle\"/>&nbsp;: " . $text['married'] . " &nbsp;&nbsp;&nbsp;&nbsp;\n";
$persontext .= "<img src=\"{$cms['tngpath']}img/184.png\" alt=\"{$text['died']}\" height=\"17\" width=\"10\" class=\"alignmiddle\"/>&nbsp;: " . $text['died'] . " &nbsp;&nbsp;&nbsp;&nbsp;\n";

You could comment out the "if($nonzeroplaces) {" line and the end of the if, or copy what is inside and make an else with this copied code inside it where you could then replace the loop.  With having about 20 markers in the legend, it could end up being a bit long.  So that is where you could download one of those mods and copy the google_text_marker.php file and the LiberationSansRegular font file and have lines that read something like:

$persontext .= '<img src="'.$cms['tngpath'].'google_text_marker.php?text='.$text['born'].'&amp;image=054.png" alt="'.$text['born'].'" />'."\n";
$persontext .= '<img src="'.$cms['tngpath'].'google_text_marker.php?text='.$text['married'].'&amp;image=010.png" alt="'.$text['married'].'" />'."\n";
$persontext .= '<img src="'.$cms['tngpath'].'google_text_marker.php?text='.$text['died'].'&amp;image=184.png" alt="'.$text['died'].'" />'."\n";

Link to comment
Share on other sites

On 14. 8. 2017 at 3:21 AM, bhemph said:

if($data['text']==$text['born']) $pinplacelevel='054';
if($data['text']==$text['married']) $pinplacelevel='010';
if($data['text']==$text['died']) $pinplacelevel='184';

That’s very nice idea. I will exploit it in my personlib.php (through my own mod). Many thanks. ☺

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...