747 Posted March 17, 2017 Report Share Posted March 17, 2017 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. Quote Link to comment Share on other sites More sharing options...
747 Posted March 20, 2017 Author Report Share Posted March 20, 2017 SOLVED. The result is very nice. Quote Link to comment Share on other sites More sharing options...
747 Posted March 21, 2017 Author Report Share Posted March 21, 2017 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. Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted March 21, 2017 Report Share Posted March 21, 2017 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. Quote Link to comment Share on other sites More sharing options...
747 Posted August 13, 2017 Author Report Share Posted August 13, 2017 I consider this idea to be ingenious. Unfortunately, writing a new mod to transform the Place Level into an Event Type is over my skill. Quote Link to comment Share on other sites More sharing options...
bhemph Posted August 14, 2017 Report Share Posted August 14, 2017 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\"/> : " . $text['born'] . " \n"; $persontext .= "<img src=\"{$cms['tngpath']}img/010.png\" alt=\"{$text['married']}\" height=\"17\" width=\"10\" class=\"alignmiddle\"/> : " . $text['married'] . " \n"; $persontext .= "<img src=\"{$cms['tngpath']}img/184.png\" alt=\"{$text['died']}\" height=\"17\" width=\"10\" class=\"alignmiddle\"/> : " . $text['died'] . " \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'].'&image=054.png" alt="'.$text['born'].'" />'."\n"; $persontext .= '<img src="'.$cms['tngpath'].'google_text_marker.php?text='.$text['married'].'&image=010.png" alt="'.$text['married'].'" />'."\n"; $persontext .= '<img src="'.$cms['tngpath'].'google_text_marker.php?text='.$text['died'].'&image=184.png" alt="'.$text['died'].'" />'."\n"; Quote Link to comment Share on other sites More sharing options...
747 Posted August 16, 2017 Author Report Share Posted August 16, 2017 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. ☺ Quote Link to comment Share on other sites More sharing options...
747 Posted August 19, 2017 Author Report Share Posted August 19, 2017 How about using EventID instead of name of the Event? It would be a universal solution for both standard and custom events. EventID can be detected, for example, using the mod http://tng.lythgoes.net/wiki/index.php?title=Add_Event_Type_ID But I do not know how to do it? Quote Link to comment Share on other sites More sharing options...
bhemph Posted September 2, 2017 Report Share Posted September 2, 2017 $data['eventtypeID'] is the variable that would match the EventID that would match the database number for the custom events. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.