Retina icon?

Permalink Browser Info Environment
I have an icon that is 60 x 60 but I'd like to scale it down to say, 30x 30 or 25 x 25 when it loads using the "ScaledSize" property:

Is there any way to do this with the existing code in this addon?

I see in single_pages > dashboard > manage > edit line 69 (pre 5.6 version:)

opts.icon = currentMarkerUrl

can that line be modified to include the Scaled Size?

Type: Discussion
Status: New
View Replies:
ScottC replied on at Permalink Reply
well.. I think the proper place to do this would be in this function under models/getIconURL()

function getIconURL(){
if($this->getIconFileObject()) return $this->getIconFileObject()->getUrl();

switch it to something like

function getIconURL($scaledSize = null){
if($this->getIconFileObject()) $ifo = $this->getIconFileObject();
$img = Loader::helper('image');
$obj = $img->getThumbnail($ifo,$scaledSize,$scaledSize);
if($obj) return $obj->src;
if($this->getIconFileObject()) return $this->getIconFileObject()->getUrl();

or something along those lines. Then you'd also need to mod models/page_mapper around line 60 to pass in the size you are looking for.

I assume there is a way to see if you are on a retina computer through user agent sniffing or something?

This isn't trivial to just drop in, I'd be happy to consider the mods but I need a bit more detail :)

Thank you,
nicolechung replied on at Permalink Reply
Yes I'm just checking it on my iPod for now. Thanks for the code sample, super appreciate it.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.