OH3 maps circle marker (km to m) & map widget

Hello,

i just discovered the feature of the circle marker in map pages. I would like to show the location of my car in the map and in addition to that the actual fuel range. The location and the range i get from the BMW ConnectedDrive binding.
The location is shown correctly, i just got the problem that the cd binding delievers the range an km and the circle marker needs the range in meters.
Off cource, i could create another item and multiply the value for the circle marker - but maybe someone has a smarter idea?

Also i wonder, i didnt found a map widget - just the page function. Is there a way to display a map in a card widget?

Thanks in advance,
Alex

Is it maybe possible, to multiply the item with 1000 at the code?

  - component: oh-map-circle-marker
    config:
      label: Reichweite
      color: yellow
      item: BMW_G31_Koordinaten
      radiusItem: BMW_G31_VerbrennerReichweitenRadius

Yep, use an expression in the radius parameter intead of radiusItem:

  - component: oh-map-circle-marker
    config:
      label: Reichweite
      color: yellow
      item: BMW_G31_Koordinaten
      radius: =Number.parseFloat(items.BMW_G31_VerbrennerReichweitenRadius.state)*1000
1 Like

Thanks, that works perfectly!

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.