Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter raphaelcimade

    (@raphaelcimade)

    Voici le bloc qui apparait en plain text :

    X’, } ); if (site[3] != null) { iconFeature.setStyle( new ol.style.Style( { image: new ol.style.Icon( { anchor: [0.5, 0.5], anchorXUnits: ‘fraction’, anchorYUnits: ‘fraction’, src: site[3], } ) } ) ); listFeatures.push( iconFeature ); } } var iconLayerSource = new ol.source.Vector( { features: listFeatures, } ); var iconLayer = new ol.layer.Vector( { source: iconLayerSource, } ); var map = new ol.Map( { target: ‘mapom’, layers: [ new ol.layer.Tile( { source: new ol.source.OSM() } ), iconLayer, ], view: new ol.View( { center: ol.proj.fromLonLat( [cdiparammaplon, cdiparammaplat] ), zoom: cdiparammapz } ) } ); jQuery( ‘#cdiompopup’ ).each( function(index) { jQuery( this ).remove(); } ); var createcdiompopup = document.createElement( ‘div’ ); createcdiompopup.id = ‘cdiompopup’; document.body.appendChild( createcdiompopup ); jQuery( document ).ready( function(seachpage) { var pagex; var pagey; jQuery( document ).on( ‘mousemove’, function(mulot) { pagex = mulot.pageX; pagey = mulot.pageY; } ); jQuery( document ).on( ‘click’, function(brosswagon) { function cleaning() { var isitmapom = document.getElementById( ‘mapom’ ); if ( ! isitmapom) { jQuery( ‘#cdiompopup’ ).each( function(index) { jQuery( this ).remove(); } ); } } setTimeout( cleaning, 2000 ); } ); map.on( ‘click’, function(evt) { var element = document.getElementById( ‘cdiompopup’ ); var cdiompopup = new ol.Overlay( { element: element, positioning: ‘bottom-center’, stopEvent: true, offset: [0, -50] } ); map.addOverlay( cdiompopup ); var feature = map.forEachFeatureAtPixel( evt.pixel, function(feature) { return feature; } ); if (feature) { var coordinates = feature.getGeometry().getCoordinates(); cdiompopup.setPosition( coordinates ); var posittop = pagey – 250; var positleft = pagex – 144; document.body.appendChild( element ); element.style = ‘top:’ + posittop + ‘px; left:’ + positleft + ‘px; height:230px; position:absolute; background-color:white; padding:3px; border:1px solid black; border-radius: 5px;’; var htmlcontent = feature.get( ‘name’ ); jQuery( element ).html( ‘

    ‘ + htmlcontent + ” ); jQuery( element ).show(); } map.on( ‘pointermove’, function(e) { if (e.dragging) { return; } } ); } ); } ); } ); } );

    Dans l’attente de votre réponse,

Viewing 1 replies (of 1 total)