Skip to content

Commit

Permalink
Merge pull request #156 from jehope/fixMapOpacity
Browse files Browse the repository at this point in the history
Fix map opacity
  • Loading branch information
jehope committed Mar 17, 2014
2 parents 672af79 + d963baa commit 48bbdaa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Donate link: http://dhpress.org/
Tags: plugin, map, open layers, markers, humanities, toolkit, video, historical, tours
Requires at least: 3.4
Tested up to: 3.8
Stable tag: 1.8.3
Stable tag: 1.8.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
4 changes: 3 additions & 1 deletion trunk/css/ol-map.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ body.fullscreen {
right: 10px;

}

#dhp-visual.olMap{
background: #eeeeee;
}
/* Overrides most theme settings for img tags in the map only */
.entry-content .olMap img,
.widget .olMap img {
Expand Down
4 changes: 2 additions & 2 deletions trunk/dhpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: DH Press | Digital Humanities Toolkit
Plugin URI: http://dhpress.org/download
Description: DHPress is a flexible, repurposable, fully extensible digital humanities toolkit designed for non-technical users.
Version: 1.8.3
Version: 1.8.4
Author: DHPress Team: Joe E Hope, Michael Newton, Pam Lach, Bryan Gaston
Author URI: http://dhpress.org/team
License: GPLv2
Expand All @@ -30,7 +30,7 @@
define( 'DHP_REQUIRED_WP_VERSION', '3.1' );
define( 'DHP_PLUGIN_URL', plugins_url('', __FILE__ ) );
define( 'DHP_MAPS_TABLE_VERSION', '0.1' );
define( 'DHP_PLUGIN_VERSION', '1.8.3' );
define( 'DHP_PLUGIN_VERSION', '1.8.4' );
define( 'SCRIPT_DEBUG', true );

/**
Expand Down
8 changes: 4 additions & 4 deletions trunk/js/dhp-maps-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,16 @@ var dhpMapsView = {
};

dhpMapsView.catFilter = new Object();

// Create layers for maps as well as controls for each
_.each(mapEP.layers, function(theLayer, index) {

opacity = 1;
if(theLayer['opacity']) {
opacity = theLayer['opacity'];
}
switch (theLayer['mapType']) {
case 'type-Blank':
newLayer = new OpenLayers.Layer("Blank Base Layer", {numZoomLevels: 20, isBaseLayer: true});
break;
case 'type-OSM':
var thisLayer = dhpData.vizParams.layerData[index];
var arrayOSM = thisLayer.dhp_map_url.split(',');
Expand Down Expand Up @@ -624,7 +625,6 @@ var dhpMapsView = {
var layerSettings = dhpMapsView.mapEP.layers;

_.each(dhpMapsView.olMap.layers,function(thisLayer,index) {
//console.log(layer.name)
layerOpacity = 1;
if(layerSettings[index]) {
layerOpacity = layerSettings[index]['opacity'];
Expand All @@ -646,7 +646,7 @@ var dhpMapsView = {
step:.05,
values: [ layerOpacity ],
slide: function( event, ui ) {
thisLayer.setOpacity(ui.values[ 0 ]);
thisLayer.setOpacity(ui.values[ 0 ]);
}
});
// Handle turning on and off map layer
Expand Down
5 changes: 4 additions & 1 deletion trunk/php/dhp-map-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ function show_dhp_map_settings_box()
case 'WMS':
$selectWMS = 'selected';
break;
case 'Blank':
$selectBlank = 'selected';
break;
case 'KML':
$selectKML = 'selected';
break;
Expand Down Expand Up @@ -224,7 +227,7 @@ function show_dhp_map_settings_box()
echo '<tr><td align=right>*Map ID:</td><td><input name="dhp_map_typeid" id="dhp_map_typeid" type="text" size="60" value="'.$mapAttributes['dhp_map_typeid'].'"/></td></tr>';
echo '<tr><td align=right>*Short title:</td><td><input name="dhp_map_shortname" id="dhp_map_shortname" type="text" size="60" value="'.$mapAttributes['dhp_map_shortname'].'"/></td></tr>';
echo '<tr><td align=right>*URL:</td><td><input name="dhp_map_url" id="dhp_map_url" type="text" size="30" value="'.$mapAttributes['dhp_map_url'].'"/></td></tr>';
echo '<tr><td align=right>*Type:</td><td><select name="dhp_map_type" id="dhp_map_type"><option value="" '.$selectType.'>Please select a type</option><option value="WMS" '.$selectWMS.' disabled>WMS</option><option value="KML" '.$selectKML.' >KML</option><option value="DHP" '.$selectDHP.'>Custom DHP</option><option value="OSM" '.$selectOSM.'>OSM</option><option value="OSM" '.$selectTMS.'>TMS</option><option value="Google" '.$selectGoogle.'>Google</option></select></td></tr>';
echo '<tr><td align=right>*Type:</td><td><select name="dhp_map_type" id="dhp_map_type"><option value="" '.$selectType.'>Please select a type</option><option value="WMS" '.$selectWMS.' disabled>WMS</option><option value="Blank" '.$selectBlank.' >Blank</option><option value="KML" '.$selectKML.' >KML</option><option value="DHP" '.$selectDHP.'>Custom DHP</option><option value="OSM" '.$selectOSM.'>OSM</option><option value="OSM" '.$selectTMS.'>TMS</option><option value="Google" '.$selectGoogle.'>Google</option></select></td></tr>';
echo '<tr><td align=right>*Category:</td><td><select name="dhp_map_category" id="dhp_map_category"><option value="" '.$selectCategory.'>Please select a category</option><option value="base layer" '.$selectBaseLayer.'>Base Layer</option><option value="overlay" '.$selectOverlay.' >Overlay</option></select></td></tr>';

echo '<tr><td align=right>*North bounds:</td><td><input name="dhp_map_n_bounds" id="dhp_map_n_bounds" type="text" size="10" value="'.$mapAttributes['dhp_map_n_bounds'].'"/></td></tr>';
Expand Down

0 comments on commit 48bbdaa

Please sign in to comment.