Skip to content

Allow amp-iframe to set amp-bind state on parent #10828

@devvercer

Description

@devvercer

What's the issue?

Feature request.

Inside an amp-form I want to create a custom "coordinate input" component that lets a user pan an embedded Google Map and the current latLng is sent as a form input.

I hoped I could use amp-iframe and amp-bind and when the map moves, call something like:

postMessage({
sentinel: 'amp',
type: 'set-state',
state: {
lat: theMapLat,
lng: theMapLng,
}
}, '*' );

My form would have something like this:

<input type="hidden" name="lat" [value]="lat"/>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions