how to adding google maps location to my website - google-maps

I use Laravel 8.x and I added google maps to my project on localhost. I got this error:
In HTML
<div id="map" class="gmaps"></div>
and added script javascript from google to load the maps
https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places&callback=initAutocomplete
<script
src="https://maps.googleapis.com/maps/api/js?key={{{{{{ MY API KEY from google }}}}}}&callback=initMap&libraries=&v=weekly"
async
></script
This is API activate
How do I solve this problem?

Well I don't know much so don't blame on me for doing it wrong but on the Google Maps website you can get the html code without having to do it yourself
A photo:
It will look something like this
<iframe src="https://www.google.com/maps/embed?pb=!1m24!1m12!1m3!1d37884.27437429994!2d10.038146266404057!3d53.5976162881659!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!4m9!3e1!4m3!3m2!1d53.605531199999994!2d10.0321597!4m3!3m2!1d53.605892999999995!2d10.1306738!5e0!3m2!1snl!2snl!4v1630424037937!5m2!1snl!2snl" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>

Related

google map Latitude and Longitude

am trying to add an iframe map at this location:
https://www.google.com/maps/place/32.2221546+35.2965266/#32.2221546,35.2965266,17z
like
<iframe src="https://www.google.com/maps/place/32.2221546+35.2965266/#32.2221546,35.2965266,17z"></iframe>
but I get an error, somebody can help me
The location code you typed is a google map format. You should use this code when you need to share directly.(for example on WhatsApp, an e-mail)
Try this instead. when you copied the location code to browser, you will see the sharing settings. There is information enough on that page.
I found out your location on this page and saw following code.
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3375.3346517032583!2d35.2965266!3d32.2221546!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x24759be185862de8!2zMzLCsDEzJzE5LjgiTiAzNcKwMTcnNDcuNSJF!5e0!3m2!1str!2str!4v1643914372999!5m2!1str!2str" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>
explanation

How to embed documents from firebase storage into Google/Microsoft document viewer

Google Docs and Microsoft office live cannot embed/render doc/pdf/ppt files from firebase storage.
I even set my firebase storage rules to be accessible publicly. I also tried embedding the url using javascript encodeURIComponent | encodeUri still doesn't resolve my problem.
//This is the public url of .ppt that I want to display in my html website:
https://firebasestorage.googleapis.com/v0/b/work-from-home-app.appspot.com/o/tasks%2Fwqk5vnsYlySImAbukg5Z%2Ftest.pptx?alt=media&token=0eabee36-844f-47de-b643-6fa7d8841dfe
I have tried several ways to do it as shown below:
<!-- This one from google docs doesnt work -->
<iframe src="//docs.google.com/gview?alt=media&embedded=true&url=https://firebasestorage.googleapis.com/v0/b/work-from-home-app.appspot.com/o/tasks%2Fwqk5vnsYlySImAbukg5Z%2Ftest.pptx?alt=media&token=0eabee36-844f-47de-b643-6fa7d8841dfe" style="width:600px; height:500px;" frameborder="0"></iframe>
<!-- This one from microsoft doesnt work either -->
<iframe src="https://view.officeapps.live.com/op/embed.aspx?src=https://firebasestorage.googleapis.com/v0/b/work-from-home-app.appspot.com/o/tasks%2Fwqk5vnsYlySImAbukg5Z%2Ftest.pptx?alt=media&token=0eabee36-844f-47de-b643-6fa7d8841dfe" style="width:600px; height:500px;" frameborder="0"></iframe>
Sadly None of the above works.
But when I tried to embed a .ppt from someone's website it's working fine.
<!-- This one works! -->
<iframe src="//docs.google.com/gview?alt=media&embedded=true&url=http://video.ch9.ms/build/2011/slides/TOOL-532T_Sutter.pptx" style="width:600px; height:500px;" frameborder="0"></iframe>
Im guessing that something is wrong with my firebase storage? Or is it not possible at all to render/display document files from firebase to google docs or microsoft api?
I finally solved it!
I ended up using google docs viewer, I cant figure out the one from Microsoft.
The reason it fails to read my document was because the api that I am binding my url is not working for some reason.
>This one doesn't work
https://docs.google.com/gview?alt=media&embedded=true&url=my_url
>Works for me
https://drive.google.com/viewerng/viewer?embedded=true&url=my_url
And take note that you need to encode your url into an encodeURIComponent
if you are using javascript for it to work.

Removing sign in link from google map

I want to remove a signin link from google map, the code which is displaying map is :
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3770.8179999384315!2d72.82549100000001!3d19.071738!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3be7c97259c1c731%3A0xea3269aa63a17fc0!2sLe+Sutra!5e0!3m2!1sen!2sin!4v1414997099454" width="450" height="285" frameborder="0" style="border:0"></iframe>
Thanks in advance.
Doesn't look like you have control over that with the embed API. You can do it with the Google Maps Javascript API v3
Related question: How to hide the Sign in button from Google maps?

Google Static Maps rejecting my request, but its enabled

I've been at this for hours now, tons of people seem to have the same problem but no one has an answer.
I'm trying to embed a static map into my website.
<iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=Phoenix%2C%20Arizona%2C%20United%20States&key=key"></iframe>
I am getting this error:
But I have the static maps API enabled in my console
This is not a static map(static maps are images), it's a embedded map.
You must enable Google Maps Embed API-service

How can I embed a classic google map?

I am trying to embed a map into my html code.
This is the map I need:
https://maps.google.es/maps?source=s_d&f=d&saddr=Av.+Andalucia&daddr=Carretera+desconocida&geocode=FcrYKwIdw5ax_w%3BFQyxLAId-qaw_w&sll=36.427964,-5.138029&sspn=0.004333,0.009452&hl=es&mra=mift&mrsp=0&sz=17&ie=UTF8&t=m&ll=36.464367,-5.173187&spn=0.110444,0.171318&z=12&output=classic
However, clicking on the embed/link button provides me with the following iFrame:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.es/maps?source=s_d&f=d&saddr=Av.+Andaluc%C3%ADa&daddr=Carretera+desconocida&geocode=FcrYKwIdw5ax_w%3BFQyxLAId-qaw_w&sll=36.427964,-5.138029&sspn=0.004333,0.009452&hl=es&mra=mift&mrsp=0&sz=17&ie=UTF8&t=m&ll=36.464367,-5.173187&spn=0.110444,0.171318&output=embed"></iframe>
which pulls back the new version of Google Maps and destroys my original route.
Anyone knows a workaround for this?
Thanks
It's possible that the Geocoding of that location is messed up. Why not use the lat/long coordinates as the destination and see if that works out for you before get the Embed link?
Seems like your destination is at 36.483361, -5.200168 in that particular map.