Compare commits
No commits in common. "838f90cdf4375f7af03c3f6c585f85634a76915a" and "7ee760dc2b4b14121f891fb824855f0e99422c2c" have entirely different histories.
838f90cdf4
...
7ee760dc2b
@ -21,24 +21,15 @@
|
||||
|
||||
|
||||
initMap: function(){
|
||||
//this.layers.push(new L.Google());
|
||||
//this.layers.push(new L.Google('TERRAIN'));
|
||||
//this.map.addLayer(this.layers[0]);
|
||||
/* L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={pk.eyJ1IjoibHJ1bGxvIiwiYSI6ImNpaDUydjdoNTAwd3BzdGx5bGlhOTh6bXYifQ.tE8QgNbVSgwP8V5LnJWA3w}', {
|
||||
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
|
||||
maxZoom: 18,
|
||||
id: 'mapbox.streets',
|
||||
accessToken: 'your.mapbox.access.token'
|
||||
}).addTo(this.map);*/
|
||||
mapboxUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibHJ1bGxvIiwiYSI6ImNpaDUydjdoNTAwd3BzdGx5bGlhOTh6bXYifQ.tE8QgNbVSgwP8V5LnJWA3w';
|
||||
var grayscale = L.tileLayer(mapboxUrl, {id: 'mapbox.light'}),
|
||||
streets = L.tileLayer(mapboxUrl, {id: 'mapbox.streets'});
|
||||
this.map = L.map('map_canvas',{center: [this.origin.lat, this.origin.lng], zoom: this.origin.zoom, layers: [grayscale,streets]});
|
||||
this.map = L.map('map_canvas',{center: [this.origin.lat, this.origin.lng], zoom: this.origin.zoom});
|
||||
this.layers.push(new L.Google());
|
||||
this.layers.push(new L.Google('TERRAIN'));
|
||||
this.map.addLayer(this.layers[0]);
|
||||
this.map.addControl(
|
||||
new L.Control.Layers(
|
||||
{
|
||||
'Grayscale':grayscale,
|
||||
'Streets': streets
|
||||
'Google':this.layers[0],
|
||||
'Google Terrain': this.layers[1]
|
||||
}, {}
|
||||
)
|
||||
);
|
||||
@ -51,17 +42,7 @@
|
||||
this.map.panTo(_latlng);
|
||||
this.marker.addEventListener('dragend', this.markerDrag, this);
|
||||
}
|
||||
//_.bindAll(this);
|
||||
//init elements
|
||||
this.file_frame = wp.media({
|
||||
multiple: false,
|
||||
library: {
|
||||
type: 'audio'
|
||||
}
|
||||
});
|
||||
console.log(this.file_frame)
|
||||
console.log('iniciando file_frame')
|
||||
|
||||
_.bindAll(this);
|
||||
this.initEvents();
|
||||
;
|
||||
|
||||
@ -70,7 +51,7 @@
|
||||
|
||||
initEvents: function(){
|
||||
$('#add_files').bind('click', this.openMediaManager);
|
||||
wp.media.frames.file_frame.on('select',this.mediaSelected, this);
|
||||
this.file_frame.on('select',this.mediaSelected, this);
|
||||
$('.delete-att-item').live('click', this.removeMedia);
|
||||
},
|
||||
|
||||
@ -78,15 +59,13 @@
|
||||
$(event.currentTarget).parents('.soundmap-attach-item').remove();
|
||||
},
|
||||
openMediaManager: function(event){
|
||||
this.file_frame = wp.media.frames.file_frame
|
||||
event.preventDefault();
|
||||
if ( this.file_frame ){
|
||||
this.file_frame.open();
|
||||
return;
|
||||
}
|
||||
};
|
||||
},
|
||||
mediaSelected: function(event){
|
||||
this.file_frame = wp.media.frames.file_frame
|
||||
var attachment = this.file_frame.state().get('selection').first().toJSON();
|
||||
var _cT = _.template(this.attachTemplate);
|
||||
var _o = _cT({
|
||||
@ -127,4 +106,4 @@
|
||||
soundmap.initMap();
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
}(jQuery));
|
@ -8,7 +8,6 @@
|
||||
layers:{},
|
||||
|
||||
initMap: function(){
|
||||
/*
|
||||
this.map = L.map('map_canvas_options',{center: [this.origin.lat, this.origin.lng], zoom: this.origin.zoom});
|
||||
this.layers.SATELLITE = new L.Google();
|
||||
this.layers.TERRAIN = new L.Google('TERRAIN');
|
||||
@ -24,21 +23,8 @@
|
||||
'Google Roadmap': this.layers.ROADMAP
|
||||
}, {}
|
||||
)
|
||||
);*/
|
||||
mapboxUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibHJ1bGxvIiwiYSI6ImNpaDUydjdoNTAwd3BzdGx5bGlhOTh6bXYifQ.tE8QgNbVSgwP8V5LnJWA3w';
|
||||
var grayscale = L.tileLayer(mapboxUrl, {id: 'mapbox.light'}),
|
||||
streets = L.tileLayer(mapboxUrl, {id: 'mapbox.streets'});
|
||||
this.map = L.map('map_canvas_options',{center: [this.origin.lat, this.origin.lng], zoom: this.origin.zoom, layers: [grayscale,streets]});
|
||||
this.map.addControl(
|
||||
new L.Control.Layers(
|
||||
{
|
||||
'Grayscale':grayscale,
|
||||
'Streets': streets
|
||||
}, {}
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
this.map.addEventListener('dragend', this.mapDrag, this);
|
||||
this.map.addEventListener('zoomend', this.mapZoom, this);
|
||||
this.map.addEventListener('baselayerchange', this.layerChange, this);
|
||||
@ -74,4 +60,4 @@
|
||||
soundmap.initMap();
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
}(jQuery));
|
20
soundmap.php
20
soundmap.php
@ -47,7 +47,7 @@ if (!class_exists('Soundmap')){
|
||||
'not_found' => __('No markers found', 'soundmap'),
|
||||
'not_found_in_trash' => __('No markers found in Trash', 'soundmap'),
|
||||
'parent_item_colon' => '',
|
||||
'menu_name' => 'Markers'
|
||||
'menu_name' => 'Markers'
|
||||
);
|
||||
|
||||
$args = array(
|
||||
@ -60,7 +60,6 @@ if (!class_exists('Soundmap')){
|
||||
'rewrite' => array( 'slug' => 'marker', 'with_front' => false ),
|
||||
'capability_type' => 'post',
|
||||
'has_archive' => true,
|
||||
'show_in_rest' => true,
|
||||
'hierarchical' => false,
|
||||
'menu_position' => 5,
|
||||
'register_meta_box_cb' => array($this, 'metaboxes_register_callback'),
|
||||
@ -83,8 +82,7 @@ if (!class_exists('Soundmap')){
|
||||
add_meta_box('soundmap-map', __("Place the Marker", 'soundmap'), array($this, 'map_meta_box'), 'marker', 'normal', 'high');
|
||||
add_meta_box('soundmap-media-info', __("Info", 'soundmap'), array($this,'info_meta_box'), 'marker', 'side', 'high');
|
||||
add_meta_box('soundmap-media-attachments', __("Media files attached.", 'soundmap'), array($this, 'attachments_meta_box'), 'marker', 'side', 'high');
|
||||
// Ya no es necesario
|
||||
//add_meta_box('soundmap-email', __("Uploader Mail", 'soundmap'), array($this, 'email_meta_box'), 'marker', 'side', 'low');
|
||||
add_meta_box('soundmap-email', __("Uploader Mail", 'soundmap'), array($this, 'email_meta_box'), 'marker', 'side', 'low');
|
||||
} //metaboxes_register_callback
|
||||
|
||||
function email_meta_box(){
|
||||
@ -174,11 +172,11 @@ if (!class_exists('Soundmap')){
|
||||
- LeafletCSS
|
||||
*/
|
||||
//wp_enqueue_script( 'google-maps', 'http://maps.google.com/maps/api/js?v=3.7&sensor=false' ); // Google Maps
|
||||
//wp_enqueue_script('mapboxjs','https://api.mapbox.com/mapbox.js/v2.2.4/mapbox.js',array(),'2.2.4',TRUE); // add Leaflet.js
|
||||
wp_enqueue_script('leafletjs','https://unpkg.com/leaflet@1.3.4/dist/leaflet.js',array(),'1.3.4',TRUE); // add Leaflet.js
|
||||
//wp_enqueue_style('mapboxcss','https://api.mapbox.com/mapbox.js/v2.2.4/mapbox.css',array(),'2.2.4','all'); // add CSS Leaflet
|
||||
wp_enqueue_style('leafletcss',"https://unpkg.com/leaflet@1.3.4/dist/leaflet.css",array(),'1.3.4','all'); // add CSS Leaflet
|
||||
//wp_enqueue_script('leaflet-plugin-google', plugins_url('js/leaflet/plugins/Google.js', __FILE__), array('leafletjs', 'google-maps'), '0.7.2', TRUE);
|
||||
wp_enqueue_script('mapboxjs','https://api.mapbox.com/mapbox.js/v2.2.4/mapbox.js',array(),'2.2.4',TRUE); // add Leaflet.js
|
||||
//wp_enqueue_script('leafletjs','http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js',array(),'0.7.2',TRUE); // add Leaflet.js
|
||||
wp_enqueue_style('mapboxcss','https://api.mapbox.com/mapbox.js/v2.2.4/mapbox.css',array(),'2.2.4','all'); // add CSS Leaflet
|
||||
//wp_enqueue_style('leafletcss','http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css',array(),'0.7.2','all'); // add CSS Leaflet
|
||||
wp_enqueue_script('leaflet-plugin-google', plugins_url('js/leaflet/plugins/Google.js', __FILE__), array('leafletjs', 'google-maps'), '0.7.2', TRUE);
|
||||
}
|
||||
|
||||
function wp_enqueue_scripts(){
|
||||
@ -216,7 +214,6 @@ if (!class_exists('Soundmap')){
|
||||
|
||||
}else if($hook == 'settings_page_soundmap-options-menu'){
|
||||
$this->enqueue_map_scripts();
|
||||
wp_enqueue_script('underscore');
|
||||
wp_enqueue_script('soundmap-config', plugins_url('js/soundmap.config.js', __FILE__), array(), '0.1', TRUE);
|
||||
wp_enqueue_style('soundmap-config-css', plugins_url('css/soundmap.config.css', __FILE__), array(), '0.1', 'all');
|
||||
|
||||
@ -336,8 +333,7 @@ if (!class_exists('Soundmap')){
|
||||
};
|
||||
}else{
|
||||
delete_post_meta($post_id, 'soundmap_attachments_id');
|
||||
// PORQUE? esto genera un null
|
||||
//add_post_meta($post_id, 'soundmap_attachments_id', 'null');
|
||||
add_post_meta($post_id, 'soundmap_attachments_id', 'null');
|
||||
};
|
||||
delete_transient( 'soundmap_JSON_markers' );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user