Skip to content

Panorama labels - #1135

Closed
Sveder wants to merge 1 commit into
falling-fruit:mainfrom
Sveder:feature/panorama-labels
Closed

Panorama labels#1135
Sveder wants to merge 1 commit into
falling-fruit:mainfrom
Sveder:feature/panorama-labels

Conversation

@Sveder

@Sveder Sveder commented Jul 5, 2026

Copy link
Copy Markdown

closes #1081

Show the same dot markers and fruit-name labels in the Street View
panorama as on the map, by extracting the map's marker/label rendering
into a shared module (locationMarkerHelpers.js) and reusing it. The
OverlayView labels attach to a StreetViewPanorama as well as a Map, so
both views render identically.

- All nearby locations get the map's dots (blue by default, orange when
  saved) plus their fruit-name label; labels use the satellite/hybrid
  style (white text, dark outline) since the panorama is imagery.
- The selected/viewed location additionally gets the orange "here" pin
  above its dot, using the same boxicons Map glyph as the map's MapPin.
- The map's own markers are hidden while Street View is open so they
  don't double up with the panorama's.
- Guard against async re-entrancy so a superseded panorama can't leave
  orphaned overlays on the shared panorama.

Closes falling-fruit#1081

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Sveder
Sveder force-pushed the feature/panorama-labels branch from b418969 to 5ec1052 Compare July 5, 2026 07:03
@Sveder Sveder changed the title Draft: Panorama labels Panorama labels Jul 6, 2026
@Sveder

Sveder commented Jul 6, 2026

Copy link
Copy Markdown
Author

Looked at the code, looks mostly fine to me. ptal :)

@wbazant
wbazant self-requested a review July 7, 2026 08:32

@wbazant wbazant left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I had some comments to help the change fit better with the rest of the code base but it's otherwise all right and it looks like it will do the right thing. Once you addressed these requests I'll take it for a spin.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of duplicating the code for an SVG can you do something so it references the imported SVG? I think src="... somehow definition of the svg here instead of the path... " is possible.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly wasn't, left the comment in the SVG

import { theme } from '../ui/GlobalStyle'

// Shared marker + label rendering used by both the map (LocationMarkers) and
// the Street View panorama (PanoramaHandler), so both look identical.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove all LLM comments from your change, and all comments that explain what the code does? Comments that explain why the code does something can stay if hard-won, like if we needed to fix a bug caused by a gotcha.

}

const getLabelStyleConfig = (mapType) => {
const configs = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be an if statement?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you pick a name without "helpers" that corresponds to something on the site?

anchor: new googleMaps.Point(24, 44),
})

// Dedupe the nearby locations by id (the viewed location may also appear in

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not right, the selected location will definitely be in the map locations list - see redux. You can just use the selected location to draw the pin and the other locations for dots.

constructor(googleMap, googleMaps, options) {
this.googleMap = googleMap
this.googleMaps = googleMaps
this.centerLocation = options.centerLocation

@wbazant wbazant Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check how I call this concept elsewhere in the code? I think I went for 'selected location'.

// Always use the satellite/hybrid label style (white text, dark
// outline) since the panorama is imagery — more readable than the
// road-map style regardless of the map's current type.
const label = createLabel(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the interface of createLabel so it accomodates this concept rather than passing MapType.Hybrid here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually since createLabel just has a big switch statement inside, we could have createWhiteTextLabel and createBlackTextLabel, call always the white one in PanoramaHandler, and have a conditional on what to call inside LocationMarkers

radius: 50,
})

// disconnect() may have run while we awaited getPanorama (a newer

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how would this happen from interactions in the UI

@wbazant wbazant self-assigned this Jul 13, 2026
@wbazant wbazant mentioned this pull request Jul 13, 2026
@wbazant

wbazant commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Thanks! I thought I can do the cleanup for the markers code, I'll take it from here, see #1142.

@wbazant wbazant closed this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add labels to panorama (google street view)

3 participants