Link to home
Start Free TrialLog in
Avatar of Arnold Layne
Arnold LayneFlag for United States of America

asked on

google maps embedded in iframe with text view problem

Google maps public site seems to ignore the view parameter of text and shows the mapview instead when embedded in an iframe. I want it to default to the text view. Here's my code.
 <iframe src="https://www.google.com/maps?view=text&f=d&layer=t&output=embed&saddr=My+Location&view=text&daddr=110 chelmsford st, chelmsford ma+to:340 billerica ave billerica ma" style="width:100%;height:900px"></iframe>

Open in new window


Any help would be appreciated.  Thanks.
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

I don't see the text view in the Embed API documentation, which seems like a huge hole:

Google Maps Embed API
https://developers.google.com/maps/documentation/embed/guide
Avatar of Arnold Layne

ASKER

Hi Bob, thanks for your response. Here is where I am getting my idea from and why I think it should work.
https://moz.com/ugc/everything-you-never-wanted-to-know-about-google-maps-parameters

There is a view parameter that can be passed to that address, and it can have a value of text or map. If I go to that address directly, it gives me the text view as it should. If I have that address in an iframe, it ignores it and gives me the map view. For what I am doing, I don't need any api key as it's merely their public map site. I don't even need to go to maps/embed in the address.

output=embed is needed or it won't open in an iframe, and that works and it does open in the iframe, but it's the map view.
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the confirmation.