ȯ°æÀº ÀÌ·¸½À´Ï´Ù
node.js
express-handlebars
mysql
sequelize
sequelize-cli
index.js
router.get£¨"/map1", function £¨req, res, next£© {
const loca = req.query.location;
models.motels.findAll£¨£©.then£¨£¨result£© => {
res.render£¨"map1", {
motel: result,
}£©;
}£©;
}£©;
map1.hbs
var positions = [
{
title: 'īī¿À',
latlng: new kakao.maps.LatLng£¨33.450705, 126.570677£©
},
{
title: '»ýÅ¿¬¸ø',
latlng: new kakao.maps.LatLng£¨33.450936, 126.569477£©
},
{
title: 'ÅÔ¹ç',
latlng: new kakao.maps.LatLng£¨33.450879, 126.569940£©
},
{
title: '±Ù¸°°ø¿ø',
latlng: new kakao.maps.LatLng£¨33.451393, 126.570738£©
}
];
À̰É
var positions = [
{ title: {{ m_name }}, //db¾ÈÀÇ m_nameÀ̶ó´Â Ä÷³
latlng: new kakao.maps.LatLng£¨{{ m_lati }}, {{ m_long }}£©} //db¾ÈÀÇ m_lati m_long Ä÷³
];
¹è¿ ´ë½Å¿¡ DB¿¡¼ Á¶È¸ÇÑ µ¥ÀÌÅ͸¦ »ç¿ëÇϰí½ÍÀºµ¥ ¹æ¹ýÀ» ¸ð¸£°Ú½À´Ï´Ù... ¾î¶»°Ô ÇØ¾ßÇÒ±î¿ä?