Ajout du module "Mappy", incompatible avec le module "Link"...
This commit is contained in:
@@ -20,19 +20,19 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
// Passage Reserve => Liste
|
||||
$('#reserveiconlist .item').live('click', function(e){
|
||||
$('#reserveiconlist .iconitem').live('click', function(e){
|
||||
e.preventDefault();
|
||||
$.post("ajax/reserveToList.php", {reserve: $(this).attr('id')});
|
||||
$('.iconlist').last().append('<li class="item" id="'+$(this).attr('id')+'">'+$(this).html()+'</li>');
|
||||
$('.iconlist').last().append('<li class="iconitem" id="'+$(this).attr('id')+'">'+$(this).html()+'</li>');
|
||||
$.fancybox.close();
|
||||
});
|
||||
|
||||
|
||||
//Passage Liste => Reserve
|
||||
$('.item').mouseover(function(){
|
||||
$('.iconitem').mouseover(function(){
|
||||
$(this).children('.deleteLink').show();
|
||||
});
|
||||
$('.item').mouseout(function(){
|
||||
$('.iconitem').mouseout(function(){
|
||||
$(this).children('.deleteLink').hide();
|
||||
});
|
||||
|
||||
|
34
js/mappy.js
Normal file
34
js/mappy.js
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#menu-bar').append($('#myAdress'));
|
||||
$('#myAdressField').keydown(function(e){
|
||||
var code = (e.keyCode ? e.keyCode : e.which);
|
||||
if(code == 13) {
|
||||
var adress = $(this).val();
|
||||
geocode(adress);
|
||||
$('#mymap').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function geocode (addr)
|
||||
{
|
||||
var geo = new Mappy.api.geolocation.Geocoder();
|
||||
geo.geocode(addr, function (results)
|
||||
{
|
||||
var map = new Mappy.api.map.Map({
|
||||
container:"#mymap"
|
||||
});
|
||||
var scalePosition = new Mappy.api.map.tools.ToolPosition('lb', new Mappy.api.types.Point(10, 0));
|
||||
var scale = new Mappy.api.map.tools.Scale(scalePosition);
|
||||
map.addTool(scale);
|
||||
var latitude = results[0].Placemark.Point.coordinates[0];
|
||||
var longitude = results[0].Placemark.Point.coordinates[1];
|
||||
var markerLayer = new Mappy.api.map.layer.MarkerLayer(40);
|
||||
map.addLayer(markerLayer);
|
||||
var icon = new Mappy.api.ui.Icon(Mappy.api.ui.Icon.DEFAULT);
|
||||
var marker = new Mappy.api.map.Marker(new Mappy.api.geo.Coordinates(latitude, longitude), icon);
|
||||
markerLayer.addMarker(marker);
|
||||
map.setCenter(new Mappy.api.geo.Coordinates(latitude,longitude),7);
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user