views:

151

answers:

1

Greetings.

I'm working with Avenza Mapublisher (an extension for Adobe Illustrator) to create an interactive map.

When exporting the map it creates a series of flash swf files, an html file, and some javascript code. The above link shows the non-formatted version. As you can see the map loads very slowly because by default all the layers are toggled on upon load. I've tried everything but can't figure out how to control which layers are shown when the map is loaded. Really all I want is the Schools, Towns, and a road layer to be active on load, and the rest to be toggled off. Ideally I would like the remaining pesticide layers to be in a pull-down menu so only one can be chosen.

I tried setting the checked="true" to "false", eliminated the checked altogether and the checkbox comes up not checked but the layer is still active. I'm thinking something must be written into the swf file that I have NO control over. Has anyone worked with this program at all. There is a free 2 week trial online if you're interested.

So the html file calls

<script src="layerCheckboxes.js" language="javaScript"></script>

and this file is bascially a variable with all the selection choices.

var checkboxes = ' \
<input type="checkbox" checked="true" value="Tulare Schools" onClick="swfLayerToggle(value, checked);" />Tulare Schools \
<input type="checkbox" checked="true" value="Towns" onClick="swfLayerToggle(value, checked);" />Towns \
<input type="checkbox" checked="true" value="Major Roads" onClick="swfLayerToggle(value, checked);" />Major Roads \
<input type="checkbox" checked="true" value="County Roads" onClick="swfLayerToggle(value, checked);" />County Roads \
<input type="checkbox" checked="true" value="1_3 Dichloropropene" onClick="swfLayerToggle(value, checked);" />1_3 Dichloropropene \
<input type="checkbox" checked="true" value="Aluminum Phosphide" onClick="swfLayerToggle(value, checked);" />Aluminum Phosphide \
<input type="checkbox" checked="true" value="Chloropicrin" onClick="swfLayerToggle(value, checked);" />Chloropicrin \
<input type="checkbox" checked="true" value="Chlorpyrifos" onClick="swfLayerToggle(value, checked);" />Chlorpyrifos \
<input type="checkbox" checked="true" value="Diazinon" onClick="swfLayerToggle(value, checked);" />Diazinon \
<input type="checkbox" checked="true" value="Fumigants" onClick="swfLayerToggle(value, checked);" />Fumigants \
<input type="checkbox" checked="true" value="Metam Sodium" onClick="swfLayerToggle(value, checked);" />Metam Sodium \
<input type="checkbox" checked="true" value="Methyl Bromide" onClick="swfLayerToggle(value, checked);" />Methyl Bromide \
<input type="checkbox" checked="true" value="Sodium Tetrathiocarbonate" onClick="swfLayerToggle(value, checked);" />Sodium Tetrathiocarbonate \
<input type="checkbox" checked="true" value="Acres Treated" onClick="swfLayerToggle(value, checked);" />Acres Treated \
<input type="checkbox" checked="true" value="Application Rate" onClick="swfLayerToggle(value, checked);" />Application Rate \
<input type="checkbox" checked="true" value="Pesticide Use" onClick="swfLayerToggle(value, checked);" />Pesticide Use \
<input type="checkbox" checked="true" value="Agriculture Use" onClick="swfLayerToggle(value, checked);" />Agriculture Use'

document.write('<form>' + checkboxes + '</form>');

and the function swfLayerToggle() is in a file called checkboxFuntions.js

function getMyApp(appName) {       
    if (navigator.appName.indexOf ("Microsoft") !=-1) { 
        return window[appName];    
    } else {         
        return document[appName];     
    }         
}         

function swfLayerToggle(layer, isOn) {    
    getMyApp("MAPublisherSWF").swfLayerToggle(layer, isOn); 
}
A: 

I work for Avenza.

Unfortunately what you want to do is not possible with MAPublisher 8.1, however it has been added to version 8.2 which is now available. Simply change the "Initially visible" setting in the web map export dialog for the layers that you don't want display when the map loads.

Josh Knauer
Thanks Josh. I think I got your phone call as well. I'm looking forward to 8.2 and will definitely get a license. This change is very exciting.
Jb