Solved

Zoom In Google Map iframe

Posted on 2014-02-14
5
3,466 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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

856 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