MCPcopy Create free account
hub / github.com/comaps/comaps / ParseMapParam

Method ParseMapParam

libs/map/mwm_url.cpp:368–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366#endif
367
368void ParsedMapApi::ParseMapParam(std::string const & key, std::string const & value, bool & correctOrder)
369{
370 using namespace map;
371
372 if (key == kLatLon)
373 {
374 double lat = 0.0;
375 double lon = 0.0;
376 if (!ParseLatLon(key, value, lat, lon))
377 {
378 LOG(LWARNING, ("Incorrect 'll':", value));
379 return;
380 }
381
382 m_mapPoints.push_back({lat, lon, "" /* m_name */, "" /* m_id */, "" /* m_style */});
383 }
384 else if (key == kZoomLevel)
385 {
386 double zoomLevel;
387 if (strings::to_double(value, zoomLevel))
388 m_zoomLevel = zoomLevel;
389 }
390 else if (key == kName)
391 {
392 if (!m_mapPoints.empty())
393 {
394 m_mapPoints.back().m_name = value;
395 }
396 else
397 {
398 LOG(LWARNING, ("Map API: Point name with no point. 'll' should come first!"));
399 correctOrder = false;
400 return;
401 }
402 }
403 else if (key == kId)
404 {
405 if (!m_mapPoints.empty())
406 {
407 m_mapPoints.back().m_id = value;
408 }
409 else
410 {
411 LOG(LWARNING, ("Map API: Point url with no point. 'll' should come first!"));
412 correctOrder = false;
413 return;
414 }
415 }
416 else if (key == kStyle)
417 {
418 if (!m_mapPoints.empty())
419 {
420 m_mapPoints.back().m_style = value;
421 }
422 else
423 {
424 LOG(LWARNING, ("Map API: Point style with no point. 'll' should come first!"));
425 return;

Callers

nothing calls this directly

Calls 7

ParseLatLonFunction · 0.85
to_intFunction · 0.85
backMethod · 0.80
to_doubleFunction · 0.50
push_backMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected