1
0

BxMapShowTemplate.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup MapShow Display last sign up users on map
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxMapShowTemplate extends BxBaseModGeneralTemplate
  12. {
  13. function __construct(&$oConfig, &$oDb)
  14. {
  15. parent::__construct($oConfig, $oDb);
  16. }
  17. function getMap()
  18. {
  19. $this->addJs(array('https://openlayers.org/en/v4.6.4/build/ol.js', 'map.js'));
  20. $this->addCss('https://openlayers.org/en/v4.6.4/css/ol.css');
  21. return $this->getJsCode('map') . $this->parseHtmlByName('map.html', array());
  22. }
  23. public function getJsCode($sType, $aParams = array(), $bWrap = true)
  24. {
  25. $aParams = array_merge(array(
  26. 'sPathToJsonData' => $this->_oConfig->getHomeUrl() . 'js/continents.geojson',
  27. 'iIntervalCheckNewInSeconds' => getParam('bx_mapshow_interval_refresh_new_users_in_seconds'),
  28. 'fCenterMapLonCoordinate' => getParam('bx_mapshow_default_center_lat_coordinate'),
  29. 'fCenterMapLatCoordinate' => getParam('bx_mapshow_default_center_lon_coordinate'),
  30. 'fMapZoom' => getParam('bx_mapshow_default_zoom')
  31. ), $aParams);
  32. return parent::getJsCode($sType, $aParams, $bWrap);
  33. }
  34. }
  35. /** @} */