1

I have to put multiple gmap markers in a map. The catch is... The location field is in the theme itself (longitude,latitude) no gmap module. I tried to enter 2 values separated by a comma but it doesn't work. I'm not very good with PHP but i have this in theme-settings.php:

// Cocoon Map Settings: Latitude

$form['cocoon_options']['cocoon_map_settings']['map_latitude'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Map Latitude'),
    '#default_value' => theme_get_setting('map_latitude'),
    '#description'   => t("Latitude for the map address."),
  );

// Cocoon Map Settings: Longitude

 $form['cocoon_options']['cocoon_map_settings']['map_longitude'] = array(
    '#type'          => 'textfield',
    '#title'         => t('Map Longitude'),
    '#default_value' => theme_get_setting('map_longitude'),
    '#description'   => t("Longitude for the map address."),
  );

And this part in the page--front.tpl.php:

<?php if (theme_get_setting('show_map')): ?>
        <div id="map-canvas" data-lat="<?php print (theme_get_setting('map_latitude')); ?>" data-lng="<?php print (theme_get_setting('map_longitude')); ?>" data-zoom="10" data-style="style-2">
        </div>
        <div class="addresses-block">
            <a data-lat="<?php print (theme_get_setting('map_latitude')); ?>" data-lng="<?php print (theme_get_setting('map_longitude')); ?>" data-string="<?php print (theme_get_setting('map_marker_text')); ?>"></a>
        </div>
    <?php endif; ?>

Can someone help me with this one? Thanks!

  • try leaflet module – user52318 Dec 10 '15 at 6:49
  • if you are using geolocation or geofield module into the field of your content go to managefield->your_map_field->edit->change Number of values ->unlimited – user52318 Dec 10 '15 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.