Revision fd04f921
Added by Andreas Kohlbecker over 12 years ago
5.x/modules/cdm_dataportal/cdm_dataportal.module | ||
---|---|---|
92 | 92 |
|
93 | 93 |
} |
94 | 94 |
|
95 |
/** |
|
96 |
* |
|
97 |
* Enter description here ... |
|
98 |
* @param unknown_type $width |
|
99 |
* @param unknown_type $occurrenceQuery |
|
100 |
* @param unknown_type $distributionQuery |
|
101 |
* @param unknown_type $legendFormatQuery |
|
102 |
* @param unknown_type $map_caption |
|
103 |
*/ |
|
104 |
function get_image_map($width, $bounding_box=false, $occurrenceQuery = false, $distributionQuery = false, $legendFormatQuery = false, $map_caption = false ){ |
|
105 |
|
|
106 |
$server = getEDITMapServiceURI(); |
|
107 |
|
|
108 |
if(!$server){ |
|
109 |
//warning message |
|
110 |
drupal_set_message('No \'Geoservice Access Point\' has been set so far. ' |
|
111 |
. 'Please configure the variable \'Geoservice Access Point\' here ' |
|
112 |
. l('CDM Dataportal Settings', 'admin/settings/cdm_dataportal/geo'), 'warning'); |
|
113 |
//message to render |
|
114 |
return "<p>No geoservice specified</p>"; |
|
115 |
} |
|
116 |
|
|
117 |
// additional query parameters as set in the data portal admin section |
|
118 |
$labels_on = variable_get('cdm_dataportal_geoservice_labels_on', 0); |
|
119 |
|
|
120 |
$query_string .= '&image=true&recalculate=false&legend=1&ms=' . $width |
|
121 |
. ($bounding_box ? '&bbox=' . $bounding_box : '') |
|
122 |
. ($labels_on ? '&label=' . $labels_on : ''); |
|
123 |
|
|
124 |
if($map_caption){ |
|
125 |
$query_string .= '&mlp=3&mc_s=Georgia,15,blue&mc=' . $map_caption; |
|
126 |
} |
|
127 |
|
|
128 |
// either occurrence or distribution - combined maps will be possible in future |
|
129 |
if ($occurrenceQuery){ |
|
130 |
|
|
131 |
$map_service_script_name = "points.php"; |
|
132 |
|
|
133 |
//fix $occurrenceQuery |
|
134 |
$occurrenceQuery = str_replace("&image=false", "", $occurrenceQuery); |
|
135 |
//$occurrenceQuery .= '&l=v%3Aatbi%2Ce_w_0'; |
|
136 |
$occurrenceQuery .= '&l=v:e_w_0'; |
|
137 |
|
|
138 |
$query_string .= "&" .$occurrenceQuery; |
|
139 |
|
|
140 |
} else if($distributionQuery){ |
|
141 |
|
|
142 |
$query_string .= "&" .$distributionQuery; |
|
143 |
|
|
144 |
$map_service_script_name = "areas.php"; |
|
145 |
|
|
146 |
// apply Plain Image map settings |
|
147 |
if (getEDITMapServiceVersionNumber() >= 1.1){ |
|
148 |
/* |
|
149 |
* example : title=a:Naturalized++non-invasive |
|
150 |
* &ad=cyprusdivs:bdcode:a:5&as=a:ff9900,,0.1,&l=tdwg4 |
|
151 |
* &ms=500&bbox=32,34,35,36&img=true&legend=1&mlp=3 |
|
152 |
* &mc_s=Georgia,15,blue&mc=&recalculate=false |
|
153 |
* |
|
154 |
* http://edit.br.fgov.be/edit_wp5/v1/rest_gen.php? |
|
155 |
* l=background_gis:b,cyprusdivs&ad=cyprusdivs%3Abdcode%3Aa%3A8%2C4 |
|
156 |
* &as=a%3A339966%2C%2C0.1%2C|b:0000ff,, |
|
157 |
* &bbox=32%2C34%2C35%2C36&img=true&legend=1&mc=&mc_s=Georgia%2C15%2Cblue |
|
158 |
* &mlp=3&ms=500&recalculate=false&title=a%3Aindigenous |
|
159 |
*/ |
|
160 |
|
|
161 |
$map_service_script_name = "rest_gen.php"; |
|
162 |
|
|
163 |
$bgcolor_areaStyleId= "y"; |
|
164 |
$baselayer_areaStyleId= "z"; |
|
165 |
$bgcolor_layer=''; |
|
166 |
$additional_area_styles = array(); |
|
167 |
|
|
168 |
// background color: |
|
169 |
if(variable_get('map_bg_color', '')){ |
|
170 |
$bgcolor_layer = "background_gis:".$bgcolor_areaStyleId; |
|
171 |
$additional_area_styles[] = $bgcolor_areaStyleId . ":" . variable_get('map_bg_color', '') . ",,"; |
|
172 |
} |
|
173 |
|
|
174 |
//TODO HACK to replace the default base layer which currently is tdwg4 !!! |
|
175 |
if(strpos($query_string, "?l=") !== FALSE){ |
|
176 |
$layer_param_token = "?l="; |
|
177 |
} else { |
|
178 |
$layer_param_token = "&l="; |
|
179 |
} |
|
180 |
if(strpos($query_string, "?as=") !== FALSE){ |
|
181 |
$areystyle_param_token = "?as="; |
|
182 |
} else { |
|
183 |
$areystyle_param_token = "&as="; |
|
184 |
} |
|
185 |
|
|
186 |
if(variable_get('map_base_layer', '')){ |
|
187 |
$query_string = str_replace($layer_param_token."tdwg4", "$layer_param_token".variable_get('map_base_layer', ''). ":" . $baselayer_areaStyleId, $query_string); |
|
188 |
} else { |
|
189 |
$query_string = str_replace($layer_param_token."tdwg4", $layer_param_token."tdwg4:".$baselayer_areaStyleId . ",", $query_string); |
|
190 |
} |
|
191 |
|
|
192 |
if($bgcolor_layer){ |
|
193 |
$query_string = str_replace($layer_param_token, $layer_param_token . $bgcolor_layer . ",", $query_string); |
|
194 |
} |
|
195 |
|
|
196 |
if(variable_get('map_base_layer_style', '')){ |
|
197 |
$additional_area_styles[] = $baselayer_areaStyleId . ":" . variable_get('map_base_layer_style', ''); |
|
198 |
} |
|
95 | 199 |
|
96 |
function get_openlayers_map($width, $occurrenceQuery = false, $distributionQuery = false, $legendFormatQuery = false, $map_caption = false ){ |
|
200 |
foreach ($additional_area_styles as $as) { |
|
201 |
$query_string = str_replace($areystyle_param_token, $areystyle_param_token . $as . "|", $query_string); |
|
202 |
} |
|
203 |
|
|
204 |
} |
|
205 |
} // end of if($distributionQuery) |
|
206 |
|
|
207 |
$mapUri = url("$server/$map_service_script_name?$query_string"); |
|
208 |
$out = '<img class="distribution_map" src="' . $mapUri . '" alt="Map" />'; |
|
209 |
// showing map caption |
|
210 |
if($map_caption){ |
|
211 |
$out .= '<div class="distribution_map_caption">' . $map_caption . '</div>' . '<br />'; //FIXME: replace <br> by according css style |
|
212 |
$out .= '</div>'; |
|
213 |
} |
|
214 |
|
|
215 |
return $out; |
|
216 |
|
|
217 |
|
|
218 |
} |
|
219 |
|
|
220 |
/** |
|
221 |
* |
|
222 |
* Enter description here ... |
|
223 |
* @param unknown_type $width |
|
224 |
* @param unknown_type $occurrenceQuery |
|
225 |
* @param unknown_type $distributionQuery |
|
226 |
* @param unknown_type $legendFormatQuery |
|
227 |
* @param unknown_type $map_caption |
|
228 |
*/ |
|
229 |
function get_openlayers_map($width, $bounding_box=false, $occurrenceQuery = false, $distributionQuery = false, $legendFormatQuery = false, $map_caption = false ){ |
|
97 | 230 |
|
98 | 231 |
_add_js_openlayers_map(); |
99 | 232 |
|
100 | 233 |
$out = '<div id="openlayers">'; |
101 | 234 |
$out .= '<div id="openlayers_map" class="smallmap"'; |
102 | 235 |
$out .= ' style="width: ' . $width . 'px; height:'.( $width / 2).'px"'; |
103 |
if($occurrenceQuery){ |
|
104 | 236 |
|
237 |
// additional query parameters as set in the data portal admin section |
|
238 |
$labels_on = variable_get('cdm_dataportal_geoservice_labels_on', 0); |
|
239 |
|
|
240 |
$openlayers_map_query_string .= '&img=false&ms=' . $width |
|
241 |
. ($bounding_box ? '&bbox=' . $bounding_box : '') |
|
242 |
. ($labels_on ? '&label=' . $labels_on : ''); |
|
243 |
|
|
244 |
if($occurrenceQuery){ |
|
105 | 245 |
//fix $occurrenceQuery |
106 |
$occurrenceQuery .= '&ms=400,350';
|
|
246 |
$occurrenceQuery .= '&bbox=-180,-90,180,90';
|
|
107 | 247 |
$occurrenceQuery .= '&l=v%3Aatbi%2Ce_w_0'; |
248 |
//$occurrenceQuery .= '&l=v:e_w_0'; |
|
108 | 249 |
$occurrenceQuery .= '&legend=0'; //TODO add to cdm service? |
109 | 250 |
|
110 |
$out .= ' occurrenceQuery="'.$occurrenceQuery.'"';
|
|
251 |
$out .= ' occurrenceQuery="' . $occurrenceQuery . '&' . $openlayers_map_query_string . '"';
|
|
111 | 252 |
} |
253 |
|
|
112 | 254 |
if($distributionQuery){ |
113 |
$out .= ' distributionQuery="'.$distributionQuery.'"';
|
|
255 |
$out .= ' distributionQuery="' . $distributionQuery . '&' . $openlayers_map_query_string . '"';
|
|
114 | 256 |
} |
257 |
|
|
115 | 258 |
if($legendFormatQuery){ |
116 | 259 |
$out .= ' legendFormatQuery="'.$legendFormatQuery.'"'; |
117 | 260 |
} |
261 |
|
|
118 | 262 |
$out .= '></div></div>'; |
119 | 263 |
|
120 | 264 |
// showing map caption |
... | ... | |
1093 | 1237 |
drupal_goto('cdm_dataportal/taxon/' . $taxon[0]->uuid . '/synonymy', 'highlite=' . $singleTaxon->uuid); |
1094 | 1238 |
} |
1095 | 1239 |
}else{ |
1096 |
// it is an accepted taxon
|
|
1240 |
// it is an accepted taxon |
|
1097 | 1241 |
if($synonym_uuid){ |
1098 | 1242 |
drupal_goto('cdm_dataportal/taxon/' . $singleTaxon->uuid . '/synonymy', 'highlite=' . $synonym_uuid); |
1099 | 1243 |
}else{ |
5.x/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme | ||
---|---|---|
805 | 805 |
. l('CDM Dataportal Settings', 'admin/settings/cdm_dataportal/geo'), 'warning'); |
806 | 806 |
//message to render |
807 | 807 |
return "<p>No geoservice specified</p>"; |
808 |
}else{ |
|
809 |
$fontStyles = array(0 => "plane", 1 => "italic"); |
|
810 |
|
|
811 |
// query cdm server for map service uri parameters |
|
812 |
$map_data_parameters = cdm_ws_get(CDM_WS_GEOSERVICE_DISTRIBUTIONMAP, $taxon->uuid); |
|
813 |
$out .= "<!-- map_data_parameters:". print_r($map_data_parameters, true) . " -->"; |
|
814 |
$query_string = $map_data_parameters->String; |
|
815 |
if(!$query_string){ |
|
816 |
// the $query_string is empty if there are no distribution areas defined |
|
817 |
return ; |
|
818 |
} |
|
808 |
} |
|
819 | 809 |
|
820 |
// some cleaning of the URI paramters, TODO is this still needed? |
|
821 |
$query_string = str_replace('%3A', ":", $query_string); |
|
822 | 810 |
|
823 |
// additional query parameters as set in the data portal admin section |
|
824 |
$display_width = variable_get('cdm_dataportal_geoservice_display_width', false); |
|
825 |
$bounding_box = variable_get('cdm_dataportal_geoservice_bounding_box', false); |
|
826 |
$labels_on = variable_get('cdm_dataportal_geoservice_labels_on', 0); |
|
811 |
$fontStyles = array(0 => "plane", 1 => "italic"); |
|
812 |
|
|
813 |
// query cdm server for map service uri parameters |
|
814 |
$map_data_parameters = cdm_ws_get(CDM_WS_GEOSERVICE_DISTRIBUTIONMAP, $taxon->uuid); |
|
815 |
$out .= "<!-- map_data_parameters:". print_r($map_data_parameters, true) . " -->"; |
|
816 |
$query_string = $map_data_parameters->String; |
|
817 |
if(!$query_string){ |
|
818 |
// the $query_string is empty if there are no distribution areas defined |
|
819 |
return ; |
|
820 |
} |
|
827 | 821 |
|
828 |
$query_string .= ($display_width ? '&ms=' . $display_width: ''). |
|
829 |
($bounding_box ? '&bbox=' . $bounding_box : '') |
|
830 |
. ($labels_on ? '&label=' . $labels_on : ''); |
|
822 |
// some cleaning of the URI paramters, TODO is this still needed? |
|
823 |
$query_string = str_replace('%3A', ":", $query_string); |
|
831 | 824 |
|
832 |
/* ------ choose the display mode, either openlayers or static image ------ */ |
|
833 | 825 |
|
834 |
if(variable_get('cdm_dataportal_map_openlayers', 1)){
|
|
826 |
/* ------ choose the display mode, either openlayers or static image ------ */
|
|
835 | 827 |
|
836 |
$query_string .= '&img=false';
|
|
828 |
if(variable_get('cdm_dataportal_map_openlayers', 1)){
|
|
837 | 829 |
|
838 |
/* =========== display distributions using the openlayers map viewer =========== */
|
|
830 |
/* =========== display distributions using the openlayers map viewer =========== */ |
|
839 | 831 |
|
840 |
$legend_url_font_size = variable_get('cdm_dataportal_geoservice_legend_font_size', 10);
|
|
841 |
$legend_url_font_style = variable_get('cdm_dataportal_geoservice_legend_font_style', 1);
|
|
842 |
$legend_url_font_style = $fontStyles[$legend_url_font_style];
|
|
843 |
$legend_url_icon_width = variable_get('cdm_dataportal_geoservice_legend_icon_width', 35);
|
|
844 |
$legend_url_icon_height = variable_get('cdm_dataportal_geoservice_legend_icon_height', 15);
|
|
832 |
$legend_url_font_size = variable_get('cdm_dataportal_geoservice_legend_font_size', 10); |
|
833 |
$legend_url_font_style = variable_get('cdm_dataportal_geoservice_legend_font_style', 1); |
|
834 |
$legend_url_font_style = $fontStyles[$legend_url_font_style]; |
|
835 |
$legend_url_icon_width = variable_get('cdm_dataportal_geoservice_legend_icon_width', 35); |
|
836 |
$legend_url_icon_height = variable_get('cdm_dataportal_geoservice_legend_icon_height', 15); |
|
845 | 837 |
|
846 |
$legendFormatQueryStr = "format=image".urlencode('/')."png&TRANSPARENT=TRUE";
|
|
847 |
$legendFormatQueryStr .= "&WIDTH=".$legend_url_icon_width."&HEIGHT=".$legend_url_icon_height."&";
|
|
848 |
//TODO why is the layer=topp:tdwg_level_4 parameter neede at all here??
|
|
849 |
$legendFormatQueryStr .="layer=topp".urlencode(':')."tdwg_level_4&LEGEND_OPTIONS=forceLabels".urlencode(':')."on;fontStyle".urlencode(':').$legend_url_font_style.";fontSize".urlencode(':').$legend_url_font_size."&SLD=".urlencode($sldLegend);
|
|
838 |
$legendFormatQueryStr = "format=image".urlencode('/')."png&TRANSPARENT=TRUE"; |
|
839 |
$legendFormatQueryStr .= "&WIDTH=".$legend_url_icon_width."&HEIGHT=".$legend_url_icon_height."&"; |
|
840 |
//TODO why is the layer=topp:tdwg_level_4 parameter neede at all here?? |
|
841 |
$legendFormatQueryStr .="layer=topp".urlencode(':')."tdwg_level_4&LEGEND_OPTIONS=forceLabels".urlencode(':')."on;fontStyle".urlencode(':').$legend_url_font_style.";fontSize".urlencode(':').$legend_url_font_size."&SLD=".urlencode($sldLegend); |
|
850 | 842 |
|
851 |
$out .= get_openlayers_map( |
|
852 |
$display_width, |
|
843 |
$out .= get_openlayers_map( |
|
844 |
variable_get('cdm_dataportal_geoservice_display_width', 300), |
|
845 |
variable_get('cdm_dataportal_geoservice_bounding_box', false), |
|
846 |
null, |
|
847 |
$query_string, |
|
848 |
$legendFormatQueryStr, |
|
849 |
variable_get('cdm_dataportal_geoservice_map_caption', '') |
|
850 |
); |
|
851 |
|
|
852 |
} else { |
|
853 |
|
|
854 |
return get_image_map( |
|
855 |
variable_get('cdm_dataportal_geoservice_display_width', 300), |
|
856 |
variable_get('cdm_dataportal_geoservice_bounding_box', false), |
|
853 | 857 |
null, |
854 | 858 |
$query_string, |
855 | 859 |
$legendFormatQueryStr, |
856 | 860 |
variable_get('cdm_dataportal_geoservice_map_caption', '') |
857 | 861 |
); |
858 | 862 |
|
859 |
} else { |
|
860 | 863 |
|
861 |
// simple image
|
|
862 |
$mapStaticCaption = '&mc_s=Georgia,15,blue&mc=' . variable_get('cdm_dataportal_geoservice_map_caption', '');
|
|
864 |
// simple image |
|
865 |
$mapStaticCaption = '&mc_s=Georgia,15,blue&mc=' . variable_get('cdm_dataportal_geoservice_map_caption', ''); |
|
863 | 866 |
|
864 |
$query_string .= '&img=true'; |
|
865 |
$query_string .= '&legend=1&mlp=3' . $mapStaticCaption . '&recalculate=false'; |
|
866 | 867 |
|
867 |
$map_service_script_name = "areas.php"; |
|
868 |
$query_string .= '&img=true'; |
|
869 |
$query_string .= '&legend=1&mlp=3' . $mapStaticCaption . '&recalculate=false'; |
|
868 | 870 |
|
869 |
// apply Plain Image map settings |
|
870 |
if (getEDITMapServiceVersionNumber() >= 1.1){ |
|
871 |
/* |
|
872 |
* example : title=a:Naturalized++non-invasive |
|
873 |
* &ad=cyprusdivs:bdcode:a:5&as=a:ff9900,,0.1,&l=tdwg4 |
|
874 |
* &ms=500&bbox=32,34,35,36&img=true&legend=1&mlp=3 |
|
875 |
* &mc_s=Georgia,15,blue&mc=&recalculate=false |
|
876 |
* |
|
877 |
* http://edit.br.fgov.be/edit_wp5/v1/rest_gen.php? |
|
878 |
* l=background_gis:b,cyprusdivs&ad=cyprusdivs%3Abdcode%3Aa%3A8%2C4 |
|
879 |
* &as=a%3A339966%2C%2C0.1%2C|b:0000ff,, |
|
880 |
* &bbox=32%2C34%2C35%2C36&img=true&legend=1&mc=&mc_s=Georgia%2C15%2Cblue |
|
881 |
* &mlp=3&ms=500&recalculate=false&title=a%3Aindigenous |
|
882 |
*/ |
|
871 |
$map_service_script_name = "areas.php"; |
|
883 | 872 |
|
884 |
$map_service_script_name = "rest_gen.php"; |
|
873 |
// apply Plain Image map settings |
|
874 |
if (getEDITMapServiceVersionNumber() >= 1.1){ |
|
875 |
/* |
|
876 |
* example : title=a:Naturalized++non-invasive |
|
877 |
* &ad=cyprusdivs:bdcode:a:5&as=a:ff9900,,0.1,&l=tdwg4 |
|
878 |
* &ms=500&bbox=32,34,35,36&img=true&legend=1&mlp=3 |
|
879 |
* &mc_s=Georgia,15,blue&mc=&recalculate=false |
|
880 |
* |
|
881 |
* http://edit.br.fgov.be/edit_wp5/v1/rest_gen.php? |
|
882 |
* l=background_gis:b,cyprusdivs&ad=cyprusdivs%3Abdcode%3Aa%3A8%2C4 |
|
883 |
* &as=a%3A339966%2C%2C0.1%2C|b:0000ff,, |
|
884 |
* &bbox=32%2C34%2C35%2C36&img=true&legend=1&mc=&mc_s=Georgia%2C15%2Cblue |
|
885 |
* &mlp=3&ms=500&recalculate=false&title=a%3Aindigenous |
|
886 |
*/ |
|
885 | 887 |
|
886 |
$bgcolor_areaStyleId= "y"; |
|
887 |
$baselayer_areaStyleId= "z"; |
|
888 |
$bgcolor_layer=''; |
|
889 |
$additional_area_styles = array(); |
|
888 |
$map_service_script_name = "rest_gen.php"; |
|
890 | 889 |
|
891 |
// background color: |
|
892 |
if(variable_get('map_bg_color', '')){ |
|
893 |
$bgcolor_layer = "background_gis:".$bgcolor_areaStyleId; |
|
894 |
$additional_area_styles[] = $bgcolor_areaStyleId . ":" . variable_get('map_bg_color', '') . ",,"; |
|
895 |
} |
|
890 |
$bgcolor_areaStyleId= "y"; |
|
891 |
$baselayer_areaStyleId= "z"; |
|
892 |
$bgcolor_layer=''; |
|
893 |
$additional_area_styles = array(); |
|
896 | 894 |
|
897 |
//TODO HACK to replace the default base layer which currently is tdwg4 !!! |
|
898 |
if(strpos($query_string, "?l=") !== FALSE){ |
|
899 |
$layer_param_token = "?l="; |
|
900 |
} else { |
|
901 |
$layer_param_token = "&l="; |
|
902 |
} |
|
903 |
if(strpos($query_string, "?as=") !== FALSE){ |
|
904 |
$areystyle_param_token = "?as="; |
|
905 |
} else { |
|
906 |
$areystyle_param_token = "&as="; |
|
907 |
} |
|
895 |
// background color: |
|
896 |
if(variable_get('map_bg_color', '')){ |
|
897 |
$bgcolor_layer = "background_gis:".$bgcolor_areaStyleId; |
|
898 |
$additional_area_styles[] = $bgcolor_areaStyleId . ":" . variable_get('map_bg_color', '') . ",,"; |
|
899 |
} |
|
908 | 900 |
|
909 |
if(variable_get('map_base_layer', '')){ |
|
910 |
$query_string = str_replace($layer_param_token."tdwg4", "$layer_param_token".variable_get('map_base_layer', ''). ":" . $baselayer_areaStyleId, $query_string); |
|
911 |
} else { |
|
912 |
$query_string = str_replace($layer_param_token."tdwg4", $layer_param_token."tdwg4:".$baselayer_areaStyleId . ",", $query_string); |
|
913 |
} |
|
901 |
//TODO HACK to replace the default base layer which currently is tdwg4 !!! |
|
902 |
if(strpos($query_string, "?l=") !== FALSE){ |
|
903 |
$layer_param_token = "?l="; |
|
904 |
} else { |
|
905 |
$layer_param_token = "&l="; |
|
906 |
} |
|
907 |
if(strpos($query_string, "?as=") !== FALSE){ |
|
908 |
$areystyle_param_token = "?as="; |
|
909 |
} else { |
|
910 |
$areystyle_param_token = "&as="; |
|
911 |
} |
|
914 | 912 |
|
915 |
if($bgcolor_layer){ |
|
916 |
$query_string = str_replace($layer_param_token, $layer_param_token . $bgcolor_layer . ",", $query_string); |
|
917 |
} |
|
913 |
if(variable_get('map_base_layer', '')){ |
|
914 |
$query_string = str_replace($layer_param_token."tdwg4", "$layer_param_token".variable_get('map_base_layer', ''). ":" . $baselayer_areaStyleId, $query_string); |
|
915 |
} else { |
|
916 |
$query_string = str_replace($layer_param_token."tdwg4", $layer_param_token."tdwg4:".$baselayer_areaStyleId . ",", $query_string); |
|
917 |
} |
|
918 | 918 |
|
919 |
if(variable_get('map_base_layer_style', '')){
|
|
920 |
$additional_area_styles[] = $baselayer_areaStyleId . ":" . variable_get('map_base_layer_style', '');
|
|
921 |
}
|
|
919 |
if($bgcolor_layer){
|
|
920 |
$query_string = str_replace($layer_param_token, $layer_param_token . $bgcolor_layer . ",", $query_string);
|
|
921 |
} |
|
922 | 922 |
|
923 |
foreach ($additional_area_styles as $as) {
|
|
924 |
$query_string = str_replace($areystyle_param_token, $areystyle_param_token . $as . "|", $query_string);
|
|
925 |
}
|
|
923 |
if(variable_get('map_base_layer_style', '')){
|
|
924 |
$additional_area_styles[] = $baselayer_areaStyleId . ":" . variable_get('map_base_layer_style', '');
|
|
925 |
} |
|
926 | 926 |
|
927 |
foreach ($additional_area_styles as $as) { |
|
928 |
$query_string = str_replace($areystyle_param_token, $areystyle_param_token . $as . "|", $query_string); |
|
927 | 929 |
} |
928 | 930 |
|
929 |
$mapUri = url("$server/$map_service_script_name?$query_string"); |
|
930 |
$out .= '<img class="distribution_map" src="' . $mapUri . '" alt="Distribution Map" />'; |
|
931 | 931 |
} |
932 |
return $out; |
|
932 |
|
|
933 |
$mapUri = url("$server/$map_service_script_name?$query_string"); |
|
934 |
$out .= '<img class="distribution_map" src="' . $mapUri . '" alt="Distribution Map" />'; |
|
933 | 935 |
} |
936 |
return $out; |
|
937 |
|
|
934 | 938 |
} |
935 | 939 |
|
936 | 940 |
/** |
5.x/modules/cdm_dataportal/theme/cdm_dataportal.page.theme | ||
---|---|---|
234 | 234 |
$specimensOrObersvations = cdm_ws_get(CDM_WS_TAXON, array($taxon->uuid, 'specimensOrObersvations') ); |
235 | 235 |
|
236 | 236 |
//collect media (fieldObjectMedia, derivedUnitMedia) and add as fields |
237 |
foreach($specimensOrObersvations as $specimensOrObersvation) {
|
|
238 |
$specimensOrObersvation->_fieldObjectMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($specimensOrObersvation->uuid, 'fieldObjectMedia') );
|
|
239 |
$specimensOrObersvation->_derivedUnitMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($specimensOrObersvation->uuid, 'derivedUnitMedia') );
|
|
237 |
foreach($specimensOrObersvations as &$occurrence) {
|
|
238 |
$occurrence->_fieldObjectMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($occurrence->uuid, 'fieldObjectMedia') );
|
|
239 |
$occurrence->_derivedUnitMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($occurrence->uuid, 'derivedUnitMedia') );
|
|
240 | 240 |
// $derivedUnitFacde = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($descriptionElement->associatedSpecimenOrObservation->uuid) ); |
241 | 241 |
// $descriptionElement->_titleCache = $derivedUnitFacde->titleCache; |
242 | 242 |
} |
243 | 243 |
|
244 |
if(variable_get('cdm_dataportal_map_openlayers', 1)){ |
|
244 |
if(count($specimensOrObersvations) > 0){ |
|
245 |
|
|
245 | 246 |
$occurrenceQuery = cdm_ws_get(CDM_WS_GEOSERVICE_OCCURRENCEMAP, $taxon->uuid); |
246 | 247 |
$occurrenceQuery = $occurrenceQuery->String; |
247 |
$out .= get_openlayers_map(variable_get('cdm_dataportal_geoservice_display_width', false), $occurrenceQuery); |
|
248 |
|
|
249 |
if(variable_get('cdm_dataportal_map_openlayers', 1)){ |
|
250 |
$out .= get_openlayers_map( |
|
251 |
variable_get('cdm_dataportal_geoservice_display_width', false), |
|
252 |
variable_get('cdm_dataportal_geoservice_bounding_box', false), |
|
253 |
$occurrenceQuery, |
|
254 |
null, |
|
255 |
$legendFormatQueryStr, |
|
256 |
variable_get('cdm_dataportal_geoservice_map_caption', '') |
|
257 |
); |
|
258 |
} else { |
|
259 |
//get_image_map($width, $occurrenceQuery = false, $distributionQuery = false, $legendFormatQuery = false, $map_caption = false ) |
|
260 |
$out .= get_image_map( |
|
261 |
variable_get('cdm_dataportal_geoservice_display_width', false), |
|
262 |
variable_get('cdm_dataportal_geoservice_bounding_box', false), |
|
263 |
$occurrenceQuery, |
|
264 |
null, |
|
265 |
$legendFormatQueryStr, |
|
266 |
variable_get('cdm_dataportal_geoservice_map_caption', '') |
|
267 |
); |
|
268 |
} |
|
269 |
|
|
248 | 270 |
} |
249 | 271 |
|
250 | 272 |
|
Also available in: Unified diff
fixing #2664 (Specimen maps are not shown in cyprus dev portal)