Can I have a USA button and a China button that moves and zooms the map?
Can the map move to China if the resultset shows China? Can the map move to USA if the resultset shows USA? Can the move and zoom include China, USA, and Pacific Ocean if the resultset shows both China and USA?
You can do all of that with the dashboard Link Switcher capabilities:
For manual country switching
- Create a form element with your countries
- Setup a link switcher like the one below
<form>
<label>Test switcher</label>
<fieldset submitButton="false">
<input type="radio" token="country">
<label>Country</label>
<choice value="China">China</choice>
<choice value="US">US</choice>
<default>China</default>
<change>
<condition value="China">
<set token="showChina">true</set>
<unset token="showUs"></unset>
</condition>
<condition value="US">
<unset token="showChina"></unset>
<set token="showUs">true</set>
</condition>
</change>
</input>
</fieldset>
<row>
<panel>
<title>Current Country</title>
<map depends="$showUs$">
<title>$country$</title>
<search>
<query>lat lon | head 1000 | lookup geo_countries longitude AS lon, latitude AS lat | stats count by featureId | geom geo_countries</query>
</search>
<option name="mapping.map.center">(37.3,-81.65)</option>
<option name="mapping.map.panning">true</option>
<option name="mapping.map.scrollZoom">false</option>
<option name="mapping.map.zoom">4</option>
<option name="mapping.type">choropleth</option>
<option name="drilldown">all</option>
</map>
<map depends="$showChina$">
<title>$country$</title>
<search>
<query>lat lon | head 1000 | lookup geo_countries longitude AS lon, latitude AS lat | stats count by featureId | geom geo_countries</query>
<earliest></earliest>
<latest></latest>
</search>
<option name="mapping.map.center">(32.32,103.62)</option>
<option name="mapping.map.panning">1</option>
<option name="mapping.map.scrollZoom">0</option>
<option name="mapping.map.zoom">4</option>
<option name="mapping.type">choropleth</option>
</map>
</panel>
</row>
</form>
For automatic country switching
Similar as above. Take a look at the "Null search swapper" example in the Splunk 6.x Dashboard Examples app to switch based on the search result
You can do all of that with the dashboard Link Switcher capabilities:
For manual country switching
- Create a form element with your countries
- Setup a link switcher like the one below
<form>
<label>Test switcher</label>
<fieldset submitButton="false">
<input type="radio" token="country">
<label>Country</label>
<choice value="China">China</choice>
<choice value="US">US</choice>
<default>China</default>
<change>
<condition value="China">
<set token="showChina">true</set>
<unset token="showUs"></unset>
</condition>
<condition value="US">
<unset token="showChina"></unset>
<set token="showUs">true</set>
</condition>
</change>
</input>
</fieldset>
<row>
<panel>
<title>Current Country</title>
<map depends="$showUs$">
<title>$country$</title>
<search>
<query>lat lon | head 1000 | lookup geo_countries longitude AS lon, latitude AS lat | stats count by featureId | geom geo_countries</query>
</search>
<option name="mapping.map.center">(37.3,-81.65)</option>
<option name="mapping.map.panning">true</option>
<option name="mapping.map.scrollZoom">false</option>
<option name="mapping.map.zoom">4</option>
<option name="mapping.type">choropleth</option>
<option name="drilldown">all</option>
</map>
<map depends="$showChina$">
<title>$country$</title>
<search>
<query>lat lon | head 1000 | lookup geo_countries longitude AS lon, latitude AS lat | stats count by featureId | geom geo_countries</query>
<earliest></earliest>
<latest></latest>
</search>
<option name="mapping.map.center">(32.32,103.62)</option>
<option name="mapping.map.panning">1</option>
<option name="mapping.map.scrollZoom">0</option>
<option name="mapping.map.zoom">4</option>
<option name="mapping.type">choropleth</option>
</map>
</panel>
</row>
</form>
For automatic country switching
Similar as above. Take a look at the "Null search swapper" example in the Splunk 6.x Dashboard Examples app to switch based on the search result
Can I compute the minimum bounding box dynamically from the resultset w/o hardcoding the coordinates and zoom of China and USA? My number of shapes way more than 2. I have custom maps and tile servers.
No, that's not possible right now