file.Open(m_total, CStdioFile::modeCreate | CStdioFile::modeNoTruncate | CStdioFile::modeWrite | CStdioFile::typeText);
file.WriteString(_T("<!DOCTYPE html>\n"));
file.WriteString(_T("<html>\n"));
file.WriteString(_T("<head>\n"));
file.WriteString(_T("\t<meta charset='utf-8'>\n"));
file.WriteString(_T("\t<title>Multi-Position Mark</title>\n"));
file.WriteString(_T("</html>\n"));
file.WriteString(_T("<body>\n"));
file.WriteString(_T("<div id='map' style='width:100 %; height:350px;'></div>\n"));
file.WriteString(_T("<script type='text/javascript' src='https://dapi.kakao.com/v2/maps/sdk.js?appkey=31b4550cf25c251d62cae2a593f6ac38'></script>\n"));
file.WriteString(_T("<script>\n"));
file.WriteString(_T("var mapContainer = document.getElementById('map'),\n"));
file.WriteString(_T("\tmapOption = {\n"));
file.WriteString(_T("\t\tcenter: new kakao.maps.LatLng(") + CavgLat + _T(", ") + CavgLon + _T("),\n"));
file.WriteString(_T("\t\tlevel: 6\n"));
file.WriteString(_T("\t};\n"));
file.WriteString(_T("var map = new kakao.maps.Map(mapContainer, mapOption);\n"));
file.WriteString(_T("var positions = [\n"));
// for문 = html에 위도, 경도 데이터 주입
for (int i = 0; i < GGALatCount; i++)
{
CString inf;
CString GGALat = CA2CT(strGroupGGALat[i].c_str()); // 위도
CString GGALon = CA2CT(strGroupGGALon[i].c_str()); // 경도
inf.Format(_T("%d"), i + 1);
file.WriteString(_T("\t{\n"));
file.WriteString(_T("\t\ttitle: '") + inf + _T("',\n"));
file.WriteString(_T("\t\tlatlng: new kakao.maps.LatLng(") + GGALat + _T(", ") + GGALon + _T(")\n"));
file.WriteString(_T("\t},\n"));
}
file.WriteString(_T("];\n"));
file.WriteString(_T("var imageSrc = 'https://t1.daumcdn.net/localimg/localimages/07/mapapidoc/markerStar.png'; \n"));
file.WriteString(_T("\n"));
file.WriteString(_T("for (var i = 0; i < positions.length; i ++) {\n"));
file.WriteString(_T("var imageSize = new kakao.maps.Size(24, 35);\n"));
file.WriteString(_T("var markerImage = new kakao.maps.MarkerImage(imageSrc, imageSize);\n"));
file.WriteString(_T("var marker = new kakao.maps.Marker({\n"));
file.WriteString(_T("map: map,\n"));
file.WriteString(_T("position: positions[i].latlng,\n"));
file.WriteString(_T("title : positions[i].title,\n"));
file.WriteString(_T("image : markerImage\n"));
file.WriteString(_T("});\n"));
file.WriteString(_T("}\n"));
file.WriteString(_T("</script>\n"));
file.WriteString(_T("</body>\n"));
file.WriteString(_T("</html>\n"));
var positions = [
{
title: '1',
latlng: new kakao.maps.LatLng(33.30344, 126.29545)
},
...........
{
title: '40',
latlng: new kakao.maps.LatLng(33.28140, 126.31317)
},
];
void CGpsParsingDlg::SetViewHtml()
{
DWORD m_NetConnectCheck = NULL;
BOOL m_NetWork = NULL;
if (InternetGetConnectedState(&m_NetConnectCheck, 0))
{
m_NetWork = TRUE;
if ((m_NetConnectCheck & INTERNET_CONNECTION_OFFLINE) != 0)
{
m_NetWork = FALSE;
}
}
else
{
m_NetWork = FALSE;
}
if (m_NetWork)
{
CRect m_map_rc;
GetDlgItem(IDC_EXPLORER_HTML_VIEW)->GetWindowRect(m_map_rc);
ScreenToClient(m_map_rc);
m_map_html_view = new explorerview();
m_map_html_view->Create(NULL, _T(""), WS_CHILD | WS_VISIBLE, m_map_rc, this, 20008);
m_map_html_view->OnInitialUpdate();
}
else
{
AfxMessageBox(_T("Not connecting Network. GPS Maps disable mode"));
}
}