
<?php if (!defined('ABSPATH')) die('No direct access allowed'); ?>
<?php
$inique_id = uniqid();
wp_enqueue_script('thememakers_theme_map_api_js', 'http://maps.google.com/maps/api/js?sensor=false');
wp_enqueue_script('thememakers_theme_markerwithlabel_js', THEMEMAKERS_THEME_URI . '/js/markerwithlabel.js');
?>

<div class="widget widget_gmap">

<?php

$controls = ""; //not need
$js_controls = '{';
if (!empty($controls)) {
    $controls = explode(',', $controls);
    if (!empty($controls)) {
        foreach ($controls as $key => $value) {
            if ($key > 0) {
                $js_controls.=',';
            }
            $js_controls.=$value . ': true';
        }
    }
}
$js_controls.='}';
?>
 <h3 class="widget-title"><?php echo $instance['title'] ?></h3>
<div class="google_map" id="google_map_<?php echo $inique_id ?>" style="width: <?php echo $instance['width'] ?>px; height: <?php echo $instance['height'] ?>px; background-color:transparent;"></div>

<script type="text/javascript">
    jQuery(function() {
        gmt_init_map(<?php echo $instance['latitude'] ?>,<?php echo $instance['longitude'] ?>, "google_map_<?php echo $inique_id ?>", <?php echo $instance['zoom'] ?>, "<?php echo $instance['maptype'] ?>",  "<?php echo ($instance['marker'] == "true" ? 1 : 0) ?>", "<?php echo ($instance['popup'] == "true" ? 1 : 0) ?>", "<?php echo ($instance['scrollwheel'] == "true" ? 1 : 0) ?>",<?php echo $js_controls ?>);
		
    });
	
</script>

</div><!--/ .widget-container-->