Sorry, I am not able to do this, I have do somethink like :

for (var i = 0; i < markersXml.length; i++) {
        var imgPath = markersXml[i].getAttribute('icon') ;

        obj = new Image();
        obj.onLoad = function() {
                this.style.width = '50%';
                this.style.height = 'auto';
        };
        obj.src= imgPath ;
}

// put maker on the map here

I can give you 30$ if you can make this working for me (based on my
code in the passed sample map url).


On 25 jan, 23:48, Rossko <[email protected]> wrote:
> > Then I am back with my case. How can I resize (scale) my marker
> > images ? I dont work if image not in cache ? Probabely a maps bug ?
>
> Why would it be a maps bug?
> Your problem is that you are trying to determine the size of an image
> before you have downloaded it.
> Don't do that.
> Use the Image objects onLoad callback.
>
> Example
>    obj = new Image();
>    obj.onLoad=imageLoaded();   // setup what do when loaded
>    obj.src='pic.gif';  // now go load it
>
> // function to be invoked on image load
>    function imageLoaded(){
>          do whatever you are doing with sizing
>    }
>
> Note there is maps code involved at all.
>
> In your case, you'll probably have to write additional code to check
> each time if all images are now ready, and if so proceed with map
> marker building.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to