How can i use snapp point in when i use measurecontrol?

المشرف العام

Administrator
طاقم الإدارة
I have problem about measurecontrol . I can use measurecontrol and i can show length to use measure control . But my problem is that .i didnt use in snap because measurecontrol is a control not layer .enter code here

measureControl = new OpenLayers.Control.Measure( OpenLayers.Handler.Path, { immediate: true, persist: true } ); measureControl.getCustomLength = function(evt) { var str = ''; str = 'Toplam: ' + (evt.units === 'km' ? evt.measure.toFixed(3) : evt.measure.toFixed(1)) + ' ' + evt.units + ' '; // uzunluk =evt.units ==='km'; uzunluk=evt.measure; return str; } map.addControl(measureControl); measureControl.events.on({ 'measure': function(evt) { $("#mesafe").html(measureControl.getCustomLength(evt)); } }); measureControl.activate();This is my measure control . And i want to snap this to point to my another vector.So when i look openlayers snapp example enter code here

var snap = new OpenLayers.Control.Snapping({ layer: measurecontrollayer, targets: [{ layer:mylayer, tolerance: 15 }] }); snap.activate(); snap is using only vector but my measurecontrol not vector .Plz show me some way i hope i can explain my question ...Also is there another way to use measure in layer linestring layer????thx everybody



أكثر...
 
أعلى