Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9320225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:35:02+00:00 2026-06-19T03:35:02+00:00

I am trying to load a static google map into a fancybox/lightbox when clicking

  • 0

I am trying to load a static google map into a fancybox/lightbox when clicking on a link.
My code is

<a href="http://maps.googleapis.com/maps/api/staticmap?
 zoom=13&size=400x400&markers=color:blue|32,50&sensor=true"><img src="icon.png" /></a>

But it won’t show, the iframe stays empty. I guess it’s because the map is supposed to be loaded as the src of an IMG element, right?

Any idea how to solve this issue?

An alternative would be to open a normal google map in theviframe but then it always shows two markers, one at the location and one “best guess” by google – is there a way to remove that “best guess” marker? See http://blog.felixsalomon.net for an example, click on the little map icon next to the title of the first post.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T03:35:03+00:00Added an answer on June 19, 2026 at 3:35 am

    Static maps (using Google Static Map API) can be rendered as regular images.

    Since your link :

    <a class="fancybox" href="http://maps.googleapis.com/maps/api/staticmap?zoom=13&size=400x400&markers=color:blue|32,50&sensor=true"><img src="icon.png" /></a>
    

    … doesn’t tell fancybox that this is an image (because it doesn’t have an image extension), you have to force the type of content fancybox needs to handle like :

    $(".fancybox").fancybox({
        "type":"image"
    });
    

    Notice that I added class="fancybox" to the anchor so fancybox can be bound to that selector.

    See JSFIDDLE (using fancybox v1.3.4)

    EDIT : Since you are using a fancybox WP plugin, alternatively you can add the image extension to the anchor at the end of the URL, adding &filename=image.jpg for instance … so your full URL will look like :

    href="http://maps.googleapis.com/maps/api/staticmap?zoom=13&size=400x400&markers=color:blue|32,50&sensor=true&filename=image.jpg"
    

    If you do this, you don’t have to edit the Easyfancybox script. Check updated JSFIDDLE

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to load images from google maps static images api into flash. When
I'm trying to show a small static google map in my app. I'm wondering
I am trying to load a property file in Java in static initialization code:
I'm trying to make a page which includes a static Google map. When the
I trying to load SFmpq.dll via this code static { Native.setProtected(true); System.setProperty(jna.library.path, new File(lib).getAbsolutePath());
Here i am trying to load my Jruby script into my java code but
With this code I am trying to load a file with data into an
i m trying load UIImages from server asynchronously in UITableViewCell. My code worked fine
Trying to load content into a div, then on click load the previous content
Trying to load a small .txt file into mysql but get all my data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.