<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I add range colors to the marker map custom in the HERE maps app? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-add-range-colors-to-the-marker-map-custom-in-the-HERE/m-p/172542#M10671</link>
    <description>&lt;P&gt;Hi Matt,&lt;/P&gt;

&lt;P&gt;I can only answer the HERE maps specific questions.&lt;BR /&gt;
For the other ones you'll need to gain some more knowledge about splunk dashboarding &amp;amp; web development.&lt;BR /&gt;
Or find someone who has a bit more experience with it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;About customizing the markers. Let's start from the custom marker map.&lt;BR /&gt;
First you need to define a function that creates the markers that will be used in your visualization.&lt;BR /&gt;
This function uses an SVG image. To create one have a look at: &lt;A href="http://svg-edit.googlecode.com/svn/branches/stable/editor/svg-editor.html"&gt;http://svg-edit.googlecode.com/svn/branches/stable/editor/svg-editor.html&lt;/A&gt;&lt;BR /&gt;
Using JavaScript you can dynamically replace certain aspects of the SVG markup to tune the marker.&lt;BR /&gt;
Then the  SVG is used for creating a map icon and that icon is used for the map marker.&lt;/P&gt;

&lt;P&gt;See the code below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var svgMarkup='&amp;lt;svg width="26" height="26" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"&amp;gt;&amp;lt;circle opacity="0.9" id="svg_1" r="12" cy="13" cx="13" stroke-width="2" stroke="#333333" fill="${FILL}"/&amp;gt;&amp;lt;text xml:space="preserve" text-anchor="middle" id="svg_2" y="18.5" x="13" stroke-width="0" font-size="10pt" font-family="Roboto" stroke="#000000" fill="#000000"&amp;gt;${TEXT}&amp;lt;/text&amp;gt;&amp;lt;/svg&amp;gt;';
var markerf= function(data){
  var value=("value" in data) ? data.value : "";
  var svg=svgMarkup.replace('${TEXT}',value);
  if(value&amp;lt;=2){
    svg=svg.replace('${FILL}',"red");
  }else if(value&amp;lt;=4){
    svg=svg.replace('${FILL}',"yellow");
  }else {
    svg=svg.replace('${FILL}',"green");
  }
  var markerIcon = new H.map.Icon(svg,{anchor:{x:12,y:12}});
  return new H.map.Marker({lat:data.lat,lng:data.lng},{icon: markerIcon});
};          
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You use this function as the marker provider when creating the HERE maps.&lt;BR /&gt;
You'll also see the function used to create the info bubbles that show up when you click the markers.&lt;BR /&gt;
The event is passed in as an argument to the function. You can use that to customize the info bubble.&lt;/P&gt;

&lt;P&gt;See:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
    var mymarkermap = new HereMarkerMap({&lt;BR /&gt;
                    id: "markermap1",&lt;BR /&gt;
                    managerid: "search1",&lt;BR /&gt;
                    el: $("#search-map"),&lt;BR /&gt;
                    height: "400px",&lt;BR /&gt;
                    marker: markerf,&lt;BR /&gt;
                    bubbleContentProvider: function(data){&lt;BR /&gt;
                        bubble="&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;&lt;DIV style="text-align:center;font-size:13pt;"&gt;"&lt;BR /&gt;
                        bubble+=("value" in data) ? data.value : ""&lt;BR /&gt;
                        bubble+=("text" in data) ? data.text : ""&lt;BR /&gt;
                        bubble+=("text1" in data) ? data.text1 : ""&lt;BR /&gt;
                        bubble+=("text2" in data) ? data.text2 : ""&lt;BR /&gt;
                        bubble+"&lt;/DIV&gt;"&lt;BR /&gt;
                        return bubble;&lt;BR /&gt;
                     }&lt;BR /&gt;
                }).render();&lt;BR /&gt;
&lt;BR /&gt;
That will give you the visualizations you requested.&lt;BR /&gt;
Hopefully this can put you on the right track for finishing your other questions.&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Mar 2015 20:29:13 GMT</pubDate>
    <dc:creator>pietervi</dc:creator>
    <dc:date>2015-03-11T20:29:13Z</dc:date>
    <item>
      <title>How do I add range colors to the marker map custom in the HERE maps app?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-add-range-colors-to-the-marker-map-custom-in-the-HERE/m-p/172541#M10670</link>
      <description>&lt;P&gt;I am looking for some help editing the markermapcustom html dashboard example in the HERE maps app. I would like to change a few things but I don't know how to edit JavaScript or SVG.&lt;/P&gt;

&lt;P&gt;I would like to change a few things. If anyone could help me with any of it that would be great!&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;First add color to the markers based on a range from the value for that location&lt;/LI&gt;
&lt;LI&gt;Remove the search bar&lt;/LI&gt;
&lt;LI&gt;Add a dropdown menu / submit button

&lt;UL&gt;
&lt;LI&gt;Dropdown menu is populated by the search results from a search.&lt;/LI&gt;
&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;When a marker is clicked have it show the data from a text column instead of showing the lat/long for that marker.&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;If possible have the pop actually show a few lines of text from a text ,text1,text2 column on separate lines if those columns are populated.&lt;/P&gt;

&lt;P&gt;Example data:&lt;BR /&gt;
lat     lng     value     text       text1       text2&lt;BR /&gt;
1       -1       5.5      1234        abcd       efgh&lt;BR /&gt;
2       -2       2        7890  &lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Clicking on item one would show:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;5.5
1234
abcd
efgh
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;clicking on item 2 would show:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2 
7890
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sorry I know this is a lot of info and a lengthy request. I would do it myself if I could. I plan to read though how it was done to learn from it.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 14:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-add-range-colors-to-the-marker-map-custom-in-the-HERE/m-p/172541#M10670</guid>
      <dc:creator>MattZerfas</dc:creator>
      <dc:date>2015-03-09T14:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add range colors to the marker map custom in the HERE maps app?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-add-range-colors-to-the-marker-map-custom-in-the-HERE/m-p/172542#M10671</link>
      <description>&lt;P&gt;Hi Matt,&lt;/P&gt;

&lt;P&gt;I can only answer the HERE maps specific questions.&lt;BR /&gt;
For the other ones you'll need to gain some more knowledge about splunk dashboarding &amp;amp; web development.&lt;BR /&gt;
Or find someone who has a bit more experience with it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;About customizing the markers. Let's start from the custom marker map.&lt;BR /&gt;
First you need to define a function that creates the markers that will be used in your visualization.&lt;BR /&gt;
This function uses an SVG image. To create one have a look at: &lt;A href="http://svg-edit.googlecode.com/svn/branches/stable/editor/svg-editor.html"&gt;http://svg-edit.googlecode.com/svn/branches/stable/editor/svg-editor.html&lt;/A&gt;&lt;BR /&gt;
Using JavaScript you can dynamically replace certain aspects of the SVG markup to tune the marker.&lt;BR /&gt;
Then the  SVG is used for creating a map icon and that icon is used for the map marker.&lt;/P&gt;

&lt;P&gt;See the code below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var svgMarkup='&amp;lt;svg width="26" height="26" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"&amp;gt;&amp;lt;circle opacity="0.9" id="svg_1" r="12" cy="13" cx="13" stroke-width="2" stroke="#333333" fill="${FILL}"/&amp;gt;&amp;lt;text xml:space="preserve" text-anchor="middle" id="svg_2" y="18.5" x="13" stroke-width="0" font-size="10pt" font-family="Roboto" stroke="#000000" fill="#000000"&amp;gt;${TEXT}&amp;lt;/text&amp;gt;&amp;lt;/svg&amp;gt;';
var markerf= function(data){
  var value=("value" in data) ? data.value : "";
  var svg=svgMarkup.replace('${TEXT}',value);
  if(value&amp;lt;=2){
    svg=svg.replace('${FILL}',"red");
  }else if(value&amp;lt;=4){
    svg=svg.replace('${FILL}',"yellow");
  }else {
    svg=svg.replace('${FILL}',"green");
  }
  var markerIcon = new H.map.Icon(svg,{anchor:{x:12,y:12}});
  return new H.map.Marker({lat:data.lat,lng:data.lng},{icon: markerIcon});
};          
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You use this function as the marker provider when creating the HERE maps.&lt;BR /&gt;
You'll also see the function used to create the info bubbles that show up when you click the markers.&lt;BR /&gt;
The event is passed in as an argument to the function. You can use that to customize the info bubble.&lt;/P&gt;

&lt;P&gt;See:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
    var mymarkermap = new HereMarkerMap({&lt;BR /&gt;
                    id: "markermap1",&lt;BR /&gt;
                    managerid: "search1",&lt;BR /&gt;
                    el: $("#search-map"),&lt;BR /&gt;
                    height: "400px",&lt;BR /&gt;
                    marker: markerf,&lt;BR /&gt;
                    bubbleContentProvider: function(data){&lt;BR /&gt;
                        bubble="&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;&lt;DIV style="text-align:center;font-size:13pt;"&gt;"&lt;BR /&gt;
                        bubble+=("value" in data) ? data.value : ""&lt;BR /&gt;
                        bubble+=("text" in data) ? data.text : ""&lt;BR /&gt;
                        bubble+=("text1" in data) ? data.text1 : ""&lt;BR /&gt;
                        bubble+=("text2" in data) ? data.text2 : ""&lt;BR /&gt;
                        bubble+"&lt;/DIV&gt;"&lt;BR /&gt;
                        return bubble;&lt;BR /&gt;
                     }&lt;BR /&gt;
                }).render();&lt;BR /&gt;
&lt;BR /&gt;
That will give you the visualizations you requested.&lt;BR /&gt;
Hopefully this can put you on the right track for finishing your other questions.&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 20:29:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-add-range-colors-to-the-marker-map-custom-in-the-HERE/m-p/172542#M10671</guid>
      <dc:creator>pietervi</dc:creator>
      <dc:date>2015-03-11T20:29:13Z</dc:date>
    </item>
  </channel>
</rss>

