Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
MapView.SetScript
Sets script trigger.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
MapView | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |
MBS( "MapView.SetScript"; MapView { ; Filename; ScriptName } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
MapView | The map view reference number. | $$MapView | |
Filename | The database file name where the script is located. | "test.fmp12" | Optional |
ScriptName | The script name. | "MyScript" | Optional |
Result
Returns OK or error.
Description
Sets script trigger.Script is called for pins with identifiers when clicked.
With version 9.5, we start passing JSON with various values included. Version 9.3 and 9.4 only pass annotation identifier.
The JSON includes mapViewID, annotationIdentifier, latitude, longitude, mouseInViewX, mouseInViewY, mouseInWindowX, mouseInWindowY, mouseLocationX, mouseLocationY, reason and overlayIdentifiers.
overlayIdentifiers are found by bounding rectangles, so we don't check polygons or circles exactly!
The JSON contains an entry reason for why the script was called including Touch, Click, AnnotationMoved, and AnnotationSelected.
With plugin version 6.0 or newer the script name can be a script ID number. In that case the plugin queries the script name for the given script ID. This allows to call scripts by ID and avoid problems if scripts are later renamed.
Notice: FileMaker 19.2 adds a fmplugin extended privileges. If you have such an extended privileges to allow the plugin to trigger scripts, you need to grant permissions for it. If such a privilege is not defined, the plugin is allowed to trigger scripts. See FileMaker product documentation for details.
Examples
Set script:
Set Variable [ $$MapView ; Value: MBS("MapView.CreateWithControl"; 0; "PlaceHolder") ]
Set Variable [ $r ; Value: MBS("MapView.SetScript"; $$MapView; Get(FileName); "PinClicked") ]
See also
Release notes
- Version 9.5
- Changed MapView.SetScript to get parameter with JSON!
- Version 9.3
- Added MapView.SetScript function.
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 9.5pr1
- Neues vom MBS Plugin 9.3
- Whats new in MBS FileMaker Plugin version 9.3
- Neues MBS FileMaker Plugin 9.3 - Über 5900 Funktionen in einem Plugin
- MBS FileMaker Plugin 9.3 - More than 5900 Functions In One Plugin
- MBS FileMaker Plugin, version 9.3pr2
- More on MapViews in FileMaker
FileMaker Magazin
This function is free to use.
Created 6th June 2019, last changed 13th November 2021