Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Zoom In Google Map iframe

Posted on 2014-02-14
5
Medium Priority
?
3,729 Views
Last Modified: 2014-05-24
Hello,

I am working on a project with the below iframe which points to a google map portal. Currently, the map loads the entire world view. I want to make it so it only loads a certain zoomed in portion of the map. I tried a few solutions through some research, but none worked. The only difference I could see between mine and others posted online is the .aspx extension to the map.


<iframe src="http://LOCAL SERVER PATH/GlobalMap.aspx?

maptype=TERRAIN&radar=true&Maintenance=No&State=PA"



width="100%" frameborder=0 height=400 width=400 scrolling=no align=center></iframe>
0
Comment
Question by:Matthew13
  • 2
5 Comments
 
LVL 38

Expert Comment

by:Tom Beck
ID: 39859712
It appears from the source of that iframe that the map is supposed to show the state of PA.

You can build the code for an html iframe directly from Google Maps. Just display a map that shows the view you want and click the link icon. That will show you the iframe markup. You can also click customize and modify the size of the map that the iframe will display.

For example, using the criteria from the iframe in your original post, Google Maps generates this iframe markup:

<iframe width="400" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?ie=UTF8&t=h&ll=40.069665,-74.729004&spn=3.362828,4.383545&z=7&output=embed"></iframe>
0
 

Author Comment

by:Matthew13
ID: 39873221
I think that will work if we are just talking about standard Google maps, my problem is that we use it integrated with management software to show statuses that is why it is shown in aspx so there is a lot more going on behind the scenes. I just was wondering if there was an easy way of zooming in using this aspx.
0
 
LVL 38

Accepted Solution

by:
Tom Beck earned 2000 total points
ID: 39873305
If you are dynamically generating the src URL of the iframe then you would need to adjust the zoom level in the aspx code that generates the URL. In the src for the iframe you see the &z=9 part? 9 is the zoom level.

You could manipulate this on the client side as well using javascript. Here's an example where I included a dropdown list of possible zoom levels to choose from:

http://jsbin.com/duq/1/edit?html,output
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question