Solved

Zoom In Google Map iframe

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why is this panel heading creating extra space 2 49
Make Line Items Look Good Over Mobile 2 55
AdminLTE with wordpress 15 52
Create tabs to show divs 9 29
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

776 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