Solved

Zoom In Google Map iframe

Posted on 2014-02-14
5
3,391 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&amp;t=h&amp;ll=40.069665,-74.729004&amp;spn=3.362828,4.383545&amp;z=7&amp;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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

762 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now