Google Groups Home
Help | Sign in
custom icon with 2 img elements?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Nacho G  
View profile
(2 users)  More options May 16, 4:19 pm
From: Nacho G <nach...@gmail.com>
Date: Fri, 16 May 2008 13:19:44 -0700 (PDT)
Local: Fri, May 16 2008 4:19 pm
Subject: custom icon with 2 img elements?
Hi, im trying to do this with google maps but im confused:
I want to place images in the map, so im creating custom markers which
are the mini-thumbnails.
I want those thumbnails to have a 1px white border (just like
www.panoramio.com), so im trying this:

function createMarker(point,thumb_url,) {
        var icon = new GIcon();
        icon.image = thumb_url;
        icon.shadow = "";
        icon.iconSize = new GSize(35, 35);
        icon.iconAnchor = new GPoint(0, 0);
        var marker = new GMarker(point, icon);
        map.addOverlay(marker);
        marker.T[0].setStyle('border','solid 1px #FFF');
        return;

}

but im seeing that for each marker, it creates 2 <img /> elements with
same properties. So, the border styles is applied just to one of them,
and it happens to be the one on the back.

What im wondering is why is this creating 2 image elements ?!

thanks in advance


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Williams  
View profile
 More options May 17, 12:01 am
From: Mike Williams <nos...@econym.demon.co.uk>
Date: Sat, 17 May 2008 05:01:09 +0100
Local: Sat, May 17 2008 12:01 am
Subject: Re: custom icon with 2 img elements?
Panoramio do it by using images that have a white border painted onto
them. If you're using a graphics application script to produce the
thumbnail images from the full size images, then the easiest thing to do
is to add code to that script to add the border.

Or you could use GIcon.label, making your "main" image be a blank white
37*37 square and using the thumb as a label.
http://econym.googlepages.com/label.htm

>What im wondering is why is this creating 2 image elements ?!

Perhaps it creates the shadow <img> even if you're not using it.

--
http://econym.googlepages.com/index.htm
The Blackpool Community Church Javascript Team


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google