[TYPO3-english] WEC Map FE User Coordinates

Jan Bartels j.bartels at arcor.de
Tue Jan 14 19:36:18 CET 2014


Am 14.01.2014 13:32, schrieb Miguel:
> And it's possible to configure WEC Map to read the coordinates from
> another field of table that we specify with typoscript maybe ? Instead
> of reading the coordinates from the table "tx_wecmap_cache" for example ?
Use a Table-map (pi3) and map the fields via TypoScript and TCA.

Configure the infobubble for your record of your EXT tx_myext (DB-fields 
mytitle and mydesc) with TypoScript:

-------8<----------
plugin.tx_wecmap_pi3.flexformTables.tx_myext {

//  where = some SQL conditions
//  limit = 10

   icon {
     iconID       = myIconID
     imagepath    = fileadmin/myicon.png
     shadowpath   = fileadmin/myshadow.png
     width        = 16
     height       = 16
     shadowWidth  = 25
     shadowHeight = 25
     anchorX      = 0
     anchorY      = 0
     infoAnchorX  = 5
     infoAnchorY  = 1
   }

   title = COA
   title {
     10 = TEXT
     10.field = mytitle
     10.wrap = <h4> | </h4>
   }

   description = COA
   description.10 {
     10 = TEXT
     10.field = mydesc
   }
}
-------8<----------

Supposing your record for your DB-table tx_myext contains the fields 
mylat/mylong for the coordinates your $TCA looks like this:

-------8<----------
// enable wec_map for DB-table tx_myext
$TCA['tx_myext']['ctrl']['EXT']['wec_map'] = array (
	'isMappable' => 1,
	'latlongFields' => array (
		'lat' => 'mylat',
		'long' => 'mylong',
	),
);

// enable map-display in BE for DB-table tx_myext
$geocodeTCA = array (
	'tx_wecmap_geocode' => array (
		'exclude' => 1,
		'label' => 'LLL:EXT:wec_map/locallang_db.xml:berecord_geocodelabel',
		'config' => array(
			'type' => 'passthrough',
			'form_type' => 'user',
			'userFunc' => 'tx_wecmap_backend->checkLatLongStatus',
             'params' => array (
               'latlongFields' => array(
               	'lat' => 'mylat',
               	'long' => 'mylong',
               ),
             ),
		),
	),
);

t3lib_extMgm::addTCAcolumns('tx_myext', $geocodeTCA, 1);
$TCA['tx_myext']['interface']['showRecordFieldList'] .= 
',tx_wecmap_geocode';
t3lib_extMgm::addToAllTCAtypes('tx_myext', 'tx_wecmap_geocode', '1', 
'after:mylat');

$mapTCA = array (
	'tx_wecmap_map' => array (
		'exclude' => 1,
		'label' => 'LLL:EXT:wec_map/locallang_db.xml:berecord_maplabel',
		'config' => array (
			'type' => 'passthrough',
			'form_type' => 'user',
			'userFunc' => 'tx_wecmap_backend->drawLatLongMap',
             'params' => array (
               'latlongFields' => array(
               	'lat' => 'mylat',
               	'long' => 'mylong',
               ),
             ),
		),
	),
);

t3lib_extMgm::addTCAcolumns('tx_myext', $mapTCA, 1);
$TCA['tx_myext']['interface']['showRecordFieldList'] .= ',tx_wecmap_map';
t3lib_extMgm::addToAllTCAtypes('tx_myext', 'tx_wecmap_map', '1', 
'after:tx_wecmap_geocode');
-------8<----------

This TCA enables the mapping of the DB-fields. Besides it enables the 
display of a map in the BE when editing your records.

I'll include this example in the next version of the documentation.

Jan



More information about the TYPO3-english mailing list