Putting PHP variables into javascript [duplicate]

Use wp_localize_script:

wp_enqueue_script('YOUR_SCRIPT_HANDLE');
$object = array(
    'zoom' => get_option('map_zoom'),
    'longitude' => get_option('map_longitude'),
    'latitude' => get_option('map_latitude'),
);
wp_localize_script('YOUR_SCRIPT_HANDLE', 'JSObject', $object);

And then use it in your JS file like JSObject.zoom and the like.