Skip to content

Commit 932900b

Browse files
authored
Update cmb2-mapbox.php
Fixed field IDs in JS
1 parent 2fb5f12 commit 932900b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cmb2-mapbox.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ function updateEditor(e) {
143143
data.features.shift();
144144
}
145145
var coords = String( data.features[0].geometry.coordinates ).split(",");
146-
document.getElementById("map_lnglat").value = data.features[0].geometry.coordinates;
147-
document.getElementById("map_lng").value = coords[0];
148-
document.getElementById("map_lat").value = coords[1];
146+
document.getElementById("<?php echo $field_type->_id( '_lnglat' ); ?>").value = data.features[0].geometry.coordinates;
147+
document.getElementById("<?php echo $field_type->_id( '_lng' ); ?>").value = coords[0];
148+
document.getElementById("<?php echo $field_type->_id( '_lat' ); ?>").value = coords[1];
149149
} else {
150150
draw
151151
.deleteAll()
152152
.getAll();
153-
document.getElementById("map_lnglat").value = '';
154-
document.getElementById("map_lng").value = '';
155-
document.getElementById("map_lat").value = '';
153+
document.getElementById("<?php echo $field_type->_id( '_lnglat' ); ?>").value = '';
154+
document.getElementById("<?php echo $field_type->_id( '_lng' ); ?>").value = '';
155+
document.getElementById("<?php echo $field_type->_id( '_lat' ); ?>").value = '';
156156
}
157157
}
158158
<?php if ( ! empty( $value['lnglat'] ) ) { ?>

0 commit comments

Comments
 (0)