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

Method SpeedCameraMark

libs/map/routing_mark.cpp:553–575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551}
552
553SpeedCameraMark::SpeedCameraMark(m2::PointD const & ptOrg) : UserMark(ptOrg, Type::SPEED_CAM)
554{
555 auto const vs = static_cast<float>(df::VisualParams::Instance().GetVisualScale());
556
557 m_titleDecl.m_primaryTextFont.m_color = df::GetColorConstant(kSpeedCameraMarkText);
558 m_titleDecl.m_primaryTextFont.m_size = kSpeedCameraMarkTextSize;
559 m_titleDecl.m_primaryOffset.x = kSpeedCameraOutlineWidth + kSpeedCameraMarkTextMargin;
560 m_titleDecl.m_anchor = dp::Left;
561
562 m_symbolNames.insert(std::make_pair(kMinSpeedCameraZoom, "speedcam-alert-l"));
563
564 df::ColoredSymbolViewParams params;
565 params.m_color = df::GetColorConstant(kSpeedCameraMarkBg);
566 params.m_anchor = dp::Left;
567 params.m_shape = df::ColoredSymbolViewParams::Shape::RoundedRectangle;
568 params.m_radiusInPixels = kSpeedCameraRadius * vs;
569 auto const minSize = 2.0f * (kSpeedCameraOutlineWidth + kSpeedCameraMarkTextMargin);
570 params.m_sizeInPixels = m2::PointF(minSize, minSize) * vs;
571 params.m_outlineColor = df::GetColorConstant(kSpeedCameraMarkOutline);
572 params.m_outlineWidth = kSpeedCameraOutlineWidth;
573 m_textBg.m_zoomInfo[kMinSpeedCameraTitleZoom] = params;
574 m_textBg.m_addTextSize = true;
575}
576
577void SpeedCameraMark::SetTitle(std::string const & title)
578{

Callers

nothing calls this directly

Calls 3

GetColorConstantFunction · 0.85
GetVisualScaleMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected