Integration of Cesium JS 3D mapping software with Drupal 8

logicp 0088eddc58 Fixing indent 7 rokov pred
boutique_data 73808e260b Initial commit 7 rokov pred
config_import_files e6fa83a243 Adding Config Import Files 7 rokov pred
mapui 73808e260b Initial commit 7 rokov pred
qd30map 73808e260b Initial commit 7 rokov pred
zone_data 73808e260b Initial commit 7 rokov pred
README.md 0088eddc58 Fixing indent 7 rokov pred

README.md

cesium-drupal

Integration of Cesium JS 3D mapping software with Drupal 8

Be sure to stick this in your theme:

function myTheme_preprocess_page(&$variables) {
    $langCode = \Drupal::languageManager()->getCurrentLanguage()->getId();
    if (\Drupal::service('path.current')->getPath() === '/map') {
        if ($langCode === 'fr') {
            $variables['#attached']['library'][] = 'qd30map/cesiumAdditionsFr';
        } else {
            $variables['#attached']['library'][] = 'qd30map/cesiumAdditions';
        }
    }

    if (isset($variables['node'])) {
        if ($variables['node']->getType() == 'boutique') {
              $variables['#attached']['library'][] = 'qd30map/cesiumMini';
                $node = \Drupal::routeMatch()->getParameter('node');
                if ($node) {
                  $variables['#attached']['drupalSettings']['boutique_title'] = $node->getTitle();
                }
        }
    }
}