<?php

function mp_url_api() {
	global $mp_api_key;
	$mp_url = array(
		'src'		=> 'https://maps.googleapis.com/maps/api/js',
		'key'		=> $mp_api_key,
		'callback'	=> 'mp_init_map',
	);
	$mp_src = "";
	foreach ($mp_url as $url_key => $url_value) {
		if ($url_key === 'src') {
			$mp_src .= $url_value;
			if (count($mp_url) > 1)
				$mp_src .= "?";
		}
		else
			$mp_src .= "&" . $url_key . "=" . $url_value;
	};

	return $mp_src;
}
?>
