When I use the private property changes to the version would break my
link to the marker image--I am showing lists of marker titles and
icons based o on the current bounds.
Mainly, I was hoping for a getter for url, since it is a keyword
argument, but I'm probably just splitting hairs on efficiency.
Well, in case someone else needs this, here was my final solution:
google.maps.MarkerImage.prototype.getUrl = function(){
var re = /\.png|\.jpg|\.gif/;
for(var p in icon){
if(re.test(this[p])){
return this[p];
}
}
return
}
Thanks for your attention.
On Nov 30, 11:22 pm, Chris Broadfoot <[email protected]> wrote:
> No, there isn't.
>
> What was wrong with your approach of using a private property?
>
>
>
>
>
>
>
> On Wed, Dec 1, 2010 at 1:38 PM, JoshN <[email protected]> wrote:
> > I was trying to figure out how to find the url of a markers icon. I had
> > been using a private property before, but realized my error and now I'm
> > curious if there is an accessor I should be using. In the meantime, I have
> > been using this, which relies on prototypejs:
>
> > google.maps.Marker.prototype.getIconUrl = function(){
> > var strs = $H(this.getIcon()).find(String);
> > re = /\.png|\.gif|\.jpg/;
> > for(var i=0;i<strs.length;i++){
> > if(re.match(strs[i])){
> > return strs[i];
> > }
> > }
> > }
>
> > I'm sure there is a much better implementation, but I'm hoping this is a
> > temp solution.
>
> > Any help is appreciated.
>
> > --
> > 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]<google-maps-js-api-v3%2B
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.
--
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.