#Does anyone have experience with Maps API?

19 messages · Page 1 of 1 (latest)

pseudo kelp
#

Probably better to explain what you need help with.

glad thistle
#

Ah yea. I want user to input a zip code so it will show on the map

#

I have the map, geocode api but I dont know how to connect both together

pseudo kelp
#

Can you share what you have so far using something like code pen

glad thistle
#

hmm never used code pen

#

Is there another way to show you the code?

pseudo kelp
#

Code Pen is nice because it'll let people see what's going on, not just look at the code.

glad thistle
#

okok wait i give it another try

#

hmm it doesnt work

#

nvm nvm

pseudo kelp
#

You can use your API key to create an iframe that you center at the latitude and longitude the that the geocoding API gives you. This is an example of what the iframe HTML needs to be. You can adjust the zoom as needed from 0 (zoomed out all the way) to 21 (zoomed into the buildings).

<iframe width="450" height="250" frameborder="0" style="border:0" referrerpolicy="no-referrer-when-downgrade" src="https://www.google.com/maps/embed/v1/view?key=AIzaSyCjyreOfAiStJe-xlp6Ixj-M5xyL-B1b9w&center=33.9697897,-118.2468148&zoom=8" allowfullscreen="">
</iframe>
glad thistle
#

does the iframe map center sync with the user input?

pseudo kelp
#

You'd need to code it to update when the button is pressed.

glad thistle
#

ohh cant I code something more simple with my code right now?

#

sorry im kinda new into API's. I thought it could be solved with a change at "center:" and some few codes more

pseudo kelp
#

It's super simple to do with the code you have now. You've just gotta add an iframe to your output that has the center set to the lat,lng

glad thistle
#

OHHHHH

#

so switching the whole "initmap" with your "iframe"?