SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    May 2012
    Location
    Sydeny
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Using jQuery to change opacity of google map tiles inside and iframe

    How can I go about targeting the map tiles inside the google maps iframe so I can then use jQuery to change the tile opacity?

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,192
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    You can't, iframes are access controlled so unless the iframe URL comes from the same domain all JavaScript manipulation is forbidden.

  3. #3
    SitePoint Member
    Join Date
    May 2012
    Location
    Sydeny
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OHHHHH gutted.

    Well that would make sense as to why when I tried targeting it with the jQuery it wasn't working... thought I had just done it wrong.

    I think Google maps V3 is possible to add inside <div> rather than the iFrame (correct me if I am wrong) so I might look down that ally. I am using a Wordpress plugin called Geo-Mashups so I might check with them if it is possible to include the maps as a <div>

    Thanks for the help.

  4. #4
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,192
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    It should wouldn't matter as Google always embeds there content within an iframe last time i checked, may i ask why you intend to change the opacity of the tiles?

  5. #5
    SitePoint Member
    Join Date
    May 2012
    Location
    Sydeny
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to lay the maps over a texture and bring the texture through... easier done in Photoshop and thats where my experience really is.

    I have managed to find find a jQuery google maps plugin that uses a <div> for the maps which is great because I open up the developer tools and wat able to find the right div and change it's opacity. So it is do able. I just have the problem now that the div that holds the tile image has no ID which makes leaves me with the challenge of how to assign id's to the tiles and then use CSS to style them.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •