I use a marker image on various places on a website. A user has the option for image upload. That size might be right for the site, but for a marker it's a bit big in many cases, so I want to use the API functions to detect big images and then resize them.
I can't get the API to return me the current image size. The code now looks like something like this:
var iconImg = new google.maps.MarkerImage('/'+myTrailers.getIcon(dataitem));
// TODO: place resize function here **
var marker = new google.maps.Marker({position: pos, map: myMap.map, content: html, icon: iconImg, id: dataitem.unit_id});
I tried using these functions googleMapsAPI-MarkerImage but somehow the function doesn't work
OrgSize = iconImg.size();
If I can detect the original size of the image, I can use it to calculate the new size something like this.
if(OrgSize[x] > 20){
NewSize[x] = 20;
NewSize[y] = OrgSize[y] * (NewSize[x] / OrgSize[x]);
Anybody a idea how to get the image size using the google maps API? Or some funky alternative?
Many thanks.