Solved

Zoom In Google Map iframe

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

23 Experts available now in Live!

Get 1:1 Help Now