:navigation-title: Form element .. include:: /Includes.rst.txt .. _developer-form-element: ====================================================== Integrate the form element "Maps2PoiPosition" in code ====================================================== .. versionadded:: 13.3.0 maps2 provides the form element `Maps2PoiPosition` for forms based on the TYPO3 form framework (EXT:form). The form element `Maps2PoiPosition` shows a map with a draggable marker, so frontend users can correct a position, which your extension has found by geocoding an address. The chapter :ref:`configuration-form-element` describes the requirements, the properties and the output of the element. This chapter is for developers of extensions, which use the element. It describes the value of the element, its validation and a complete example: a form, which geocodes the entered address and stores the corrected position. .. contents:: :local: .. _developer-form-element-responsibilities: Tasks of maps2 and of your extension ==================================== maps2 renders the map, writes the position of the marker into the form and validates the submitted position. Your extension * ships the form definition with the element, * sets the initial position, for example after geocoding an address, * stores the submitted position, for example in a finisher. .. _developer-form-element-value: Value of the form element "Maps2PoiPosition" ============================================ The value of the element is an array with the keys `latitude` and `longitude`. Both values are numeric strings: .. code-block:: php :caption: Value of the form element "Maps2PoiPosition" [ 'latitude' => '48.663012', 'longitude' => '9.218945', ] The template of the element renders two hidden fields, which the JavaScript of maps2 updates with the position of the marker, rounded to 6 decimals: .. code-block:: text tx_form_formframework[