Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

Map tips provide the user with the ability to quickly retrieve information about entities underneath the mouse cursor.

They use data definitions to supply the data, meaning that the data available to the user can come from any provider, not just the attributes attached to the underlying spatial feature.

The map tip tool can query any entity and is not dependent upon the active entity. The user chooses from the map tip menu what data they're interested in and when they move the mouse around the map that's the data they will be shown.

ID

weave.maptips

Properties

Name

TypeRequiredDefault

Description

minScale

numberno0

The default minimum scale below which no map tips will be shown to the user.

maxScale

numbernoinfinity

The default maximum scale above which no map tips will be shown to the user.

radius

numberno3

The default radius, in map units, of the area to be searched, centred on the mouse location.

pressed

booleannofalse

This sets the initial state of the map tips. Setting it to 'true' will turn on map tips at startup.

multipleMaximum

numberno1

If the search returns more than this many results then multipleText will be shown to the user instead of the results. If these many or fewer results are available then they're all shown.

multipleText

stringnoThere are too many features at that location

The text to show to the user if more than multipleMaximum results are available.

tip

tipyes

A tip tag must be created for each set of data that's to be made available to the user for display in a map tip.

autoSizebooleannofalsetrue/false indicating if the popup window should try and adjust its size.
minSizesizeno105,10The minimum width and height in pixels that the popup window should use when auto-sizing.
maxSizesizeno1200,660The maximum width and height in pixels that the popup window should use when auto-sizing.
sizesizeno200,200The default width and height in pixels that the popup windows should use.
hideDelaynumberno2000The number of milliseconds to wait before hiding the popup window.
selectedOnlybooleannofalseRestrict the map tip to the selected features only.
selectedOnlyMenubooleannofalseAdd a menu to the map tips tool to allow the user to turn on or off the selectedOnly flag.
visibleOnlybooleannofalseRestrict the map tip to display only if the associated layer is turned on in the ToC. Only available since 2.5.26
visibleOnlyMenubooleannofalseAdd a menu to the map tips tool to allow the user to turn on or off the visibleOnly flag. Only available since 2.5.26
showGeometrybooleannotrueShould the geometry of the related entity be drawn. Only available since 2.5.26

Sub-Tags

tip

NameTypeRequiredDescription
minScalenumberno

The minimum scale below which no map tips will be shown to the user.

maxScalenumberno

The maximum scale above which no map tips will be shown to the user.

radiusnumberno

The radius, in map units, of the area to be searched, centred on the mouse location.

isDefaultbooleanno

Should be set to 'true' in the tip that should be enabled by default.

dataDatayes, if datadefinition is not setThe id of a Data configuration that provides the data for this particular tip.
datadefinitionData Definitionyes, if data is not setThe id of a Data Definition configuration that provides the data for this particular tip.
entityEntityyes, if datadefinition is setThe id of the Entity that the Data Definition should generate the data for.
labelstring

yes, if datadefinition is set

no, if data is set

The label to display as this tip in the menu. Will override the label provided by the Data if data is specified rather than datadefinition.
autoSizebooleannoIndicating if the popup window should try and adjust its size
minSizesizenoThe minimum width and height in pixels that the popup window should use when auto-sizing.
maxSizesizenoThe maximum width and height in pixels that the popup window should use when auto-sizing.
sizesizenoThe default width and height in pixels that the popup windows should use
selectedOnlybooleannoRestrict the map tip to the selected features only.
visibleOnlybooleannoRestrict the map tip to display only if the associated layer is turned on in the ToC.
groupstringnoA map tip with a group set will be placed under a sub-menu where the text of the sub-menu item will be taken from the group value, if a group isn't specified then the map tip will appear directly in the menu. Only available since 2.5.26
templatestringnoUsed to apply HTML formatting to the tip for display in the popup.

size

NameTypeRequiredDescription
widthnumberyesThe width of the "size", in pixels
heightnumberyesThe height of the "size' in pixels

Notes

  • Only one of data or datadefinition should be set for a tip, but one of them must be set.

  • The default values for tips are taken from the matching attribute in the parent tag.

Examples

<item action="weave.maptips">
	<tip>
		<data>property_details</data>
		<isDefault>true</isDefault>
	</tip>
	<tip>
		<data>road_details</data>
	</tip>
</item>
<item action="weave.maptips">
	<multipleMaximum>2</multipleMaximum>
	<multipleText>Too many features</multipleText>
	<minScale>1000</minScale>
	<maxScale>50000</maxScale>
	<radius>3</radius>
	<tip>
		<data>property_details</data>
		<isDefault>true</isDefault>
	</tip>
	<tip>
		<data>road_details</data>
	</tip>
</item>
<item action="weave.maptips">
	<pressed>true</pressed>
	<tip>
		<label>Property</label>
		<entity>property</entity>
		<datadefinition>property_details</datadefinition>
		<isDefault>true</isDefault>
		<minScale>1000</minScale>
		<maxScale>10000</maxScale>
	</tip>
	<tip>
		<datadefinition>road_details</datadefinition>
		<entity>roads</entity>
		<label>Road</label>
		<radius>5</radius>
		<minScale>250</minScale>
		<maxScale>1000</maxScale>
	</tip>
</item>
Adjusting the size of the popup
<item action="weave.maptips">
	<autoSize>true</autoSize>
	<minSize width="100" height="100"/>
	<maxSize width="200" height="400"/>
	<size width="150" height="150"/>
	<tips>
		<tip label="Property" entity="property" datadefinition="property_details" isDefault="true"/>
		<tip label="Image" entity="property" datadefinition="property_images">
			<maxSize width="800" height="800"/>
		</tip>
	</tips>
</item>
Formatting the text in the popup
<item action="weave.maptips">
	<tip>
		<data>property_details</data>
		<template><![CDATA[<div><h1><i>ADDRESS DETAILS:</i></h1>{address_num} {street_name} {street_type}<br>{suburb}</div>]]></template>
	</tip>
</item>
Map tips with groups
<item action="weave.maptips">
	<tip>
		<data>property_details</data>
		<isDefault>true</isDefault>
		<group>Property</group>
	</tip>
	<tip>
		<data>property_summary</data>
		<group>Property</group>
	</tip>
	<tip>
		<data>property_owner</data>
		<group>Property</group>
	</tip>
	<tip>
		<data>road_details</data>
	</tip>
	<tip>
		<data>serwer_details</data>
		<group>Sewer</group>
	</tip>
	<tip>
		<data>sewer_summary</data>
		<group>Sewer</group>
	</tip>
</item>

The above example will result in a menu like the following

  •  Property
    • Property Details
    • Property Summary
    • Property Owner
  • Road Details
  • Sewer
    • Sewer Details
    • Sewer Summary
  • No labels