我正在使用Symfony2.使用此代码生成pdf文件时:
public function printAction($id)
{
// initialiser $demande
$html = $this->renderView('PFETimeBundle:Demande:print.html.twig',
array('demande'=> $demande)
);
return new Response(
$this->get('knp_snappy.pdf')->getOutputFromHtml($html),
200,
array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="file.pdf"'
)
);
}
Run Code Online (Sandbox Code Playgroud)
我收到这个内容(法语字符出现在坏字符中):
我想得到用户的当前位置并计算该位置与其他位置之间的距离.我正在使用本教程:在Ionic 2中使用Google地图创建附近的地方列表.这是代码:
let usersLocation;
Geolocation.getCurrentPosition().then((position) => {
usersLocation = { lat :position.coords.latitude , lng : position.coords.longitude }
locations.map((location) => {
let placeLocation = {
lat: location.latitude,
lng: location.longitude
};
location.distance = this.getDistanceBetweenPoints(
usersLocation,
placeLocation,
'miles'
).toFixed(2);
});
});
Run Code Online (Sandbox Code Playgroud)
问题是:usersLocation变量未设置当前用户位置的纬度和经度.你能帮助我吗!!