ID:1670090
 
Resolved
map.zoom did not take effect at load time.
BYOND Version:507
Operating System:Windows 8 Pro 64-bit
Web Browser:Chrome 37.0.2062.102
Applies to:Webclient
Status: Resolved (507.1255)

This issue has been resolved.
Descriptive Problem Summary:
Tried using the zoom/icon-size skinparams, but neither seem to work.

Expected Results:
When zoom=1 or icon-size=48 BYOND should display the map at 48x48 per tile.

Actual Results:
Tiles are larger than 48x48.

Does the problem occur:
Every time? Or how often?
Every time.

When does the problem NOT occur?
The problem can be mitigated by manually setting the width/height of the map control.

However: The map is completely black if icon-size is used together with setting a width&height.

Workarounds:
Manually set the width and height of the map (div) element.
I have not observed any issues with either zoom=0 or zoom=1, which are the only values we currently support. Do you have a test project that shows this?
This is my game.dms file:

<style>
body {
text-align: center;
}

body, table, td, input, textarea
{
font-family: Arial, sans-serif;
font-size: 12px;
}

* {
border-color: currentColor;
}
#skin
{
display: inline-block;
position: relative;
width: 980px;
text-align: left;
margin: 0 auto;
}

.byond_input input {
border-width: 1px;
border-style: solid;
}

#map
{
width: 100%;
height: 436px;
}

#bottom
{
height: calc(100% - 436px);
}

#bottom > div.pane
{
height: 100%;
}

#output
{
height: calc(100% - 21px);
}

#input
{
width: 100%;
height: 21px;
}

#input > input:focus
{
outline: none;
}

#browser
{
width: 100%;
height: 100%;
display: none;
}

#game
{
height: 100%;
}
</style>
<script>
</script>
<body>
<div id="browser" byondclass="browser" skinparams="is-default=1"></div>
<div id="game">
<div id="mappane">
<div id="map" byondclass="map" skinparams="is-default=1;zoom=1"></div>
</div>
<div id="bottom">
<div id="output" byondclass="output" skinparams="is-default=1"></div>
<div id="input" byondclass="input" isdefault="1" skinparams="is-default=1;command=!> "></div>
</div>
</div>
</body>


world.icon_size=48

Neither zoom=1 nor icon-size=48 work.

Expected results: Icons are scaled to 48x48 and will never become bigger.

Actual results: Icons are scaled to 62x62.

Workaround: Replace "436px" with "336px" in my .dms sample.
In response to Sir Lazarus
Sir Lazarus wrote:
This is my game.dms file:

...
<div id="map" byondclass="map" skinparams="is-default=1;zoom=1"></div>
...


world.icon_size=48

Neither zoom=1 nor icon-size=48 work.
Kaiochao: whoops :)
Sir Lazarus: :P
Kaiochao: can you try putting winset(src, "map", "zoom=1") in Login()
Sir Lazarus: works!
Kaiochao: i'll consider that my redemption
So apparently zoom isn't being respected at startup. I'll find out what I can.
Lummox JR resolved issue with message:
map.zoom did not take effect at load time.
Using 507.1255, I can confirm that this has not been fixed (if the issue is on the dart code on the website itself, the version is mostly irrelevant).
Please provide a test project that shows the issue in action. I tried this and got it to work when I tested.
The test project you sent has zoom=2, which is not supported per the documentation. The map is therefore behaving as expected by falling back on zoom 0.
In response to Lummox JR
Am I missing something? In the project I sent I never use zoom=2.

In the skin I set zoom to 1.
<div id="map" byondclass="map" skinparams="is-default:1;zoom:1"></div>


This does not have any effect on the display. However, if I somewhere I set it with a winset call:

winset(src, "map", "zoom=1")


Then it works as intended.
The project you sent me via the pager has its map set to icon size 32, but the world's icon size is 16. So it's set to icon-size=32 and zoom=2 in the .dmf file.
Based on the discrepancy between the two icon sizes, it overwrites what's set in the .dms file?

Because what I'm getting at is I never directly wrote "zoom=2" or the like. Is it being set automatically?
Ah, right, the .dms should override the .dmf. I believe the issue is that the skinparams setting is formatted incorrectly. I ran into this a few times myself by accident, but it's really meant to parse much like a winset command, so it should look like this:

<div id="map" byondclass="map" isdefault=1 skinparams="zoom=1"></div>
In response to Lummox JR
Oh jeez, I didn't realize that! In that case, there is no issue here.

Thanks, and sorry for wasting your time!
No problem. I've got bitten by the skinparams thing enough (I think we were both confusing it for a style-like syntax) that I might modify how that's parsed.
On further review this behavior is not desirable for translated .dmf skins, and has been disabled for those per id:1677401. For regular new .dms-based skins, the startup value of map.zoom will be respected.