<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
At this point, I don't know what could be the cause of this
behavior. Could you provide a small live demo showing the issue ?<br>
<br>
Alexandre<br>
<br>
<br>
On 12-08-17 09:14 AM, <a class="moz-txt-link-abbreviated" href="mailto:ontwerp@limotec.be">ontwerp@limotec.be</a> wrote:<br>
</div>
<blockquote cite="mid:A2378BCBFAE74A54AC6F391F2B310150@OntwerpPC021"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div dir="ltr">
<div style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE:
12pt">
<div>Hi</div>
<div> </div>
<div>The code is below.</div>
<div> </div>
<div>The problem is that after a pan or zoom the onSelect
function of the SelectFeature is no longer called.
DragFeature still works.</div>
<div style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY:
'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT:
normal; TEXT-DECORATION: none">
<div style="FONT: 10pt tahoma">
<div> </div>
<div> </div>
<div><script
src="@Url.Content("~/Scripts/OpenLayers/OpenLayers.debug.js")"></script></div>
<div> </div>
<div><script></div>
<div> </div>
<div> var map;</div>
<div> var groundPLan;</div>
<div> var icon;</div>
<div> var markers;</div>
<div> var clickedMarker = null;</div>
<div> </div>
<div> function init() {</div>
<div> </div>
<div> groundPLan = new OpenLayers.Layer.XYZ(</div>
<div> 'GroundPlan',</div>
<div> '@Url.Content("~/Maps/" +
ViewBag.Id)/${z}/${x}/${y}.jpg',</div>
<div> {</div>
<div> attribution: "© Limotec",</div>
<div> sphericalMercator: false,</div>
<div> wrapDateLine: false,</div>
<div> transitionEffect: 'resize',</div>
<div> buffer: 1,</div>
<div> numZoomLevels: 5</div>
<div> }</div>
<div> );</div>
<div> </div>
<div> map = new OpenLayers.Map('map_canvas', {
controls: [] });</div>
<div> map.addLayer(groundPLan);</div>
<div> map.addControl(new
OpenLayers.Control.Attribution());</div>
<div> map.addControl(new
OpenLayers.Control.Navigation({ dragPanOptions: {
enableKinetic: true} }));</div>
<div> map.setCenter(new OpenLayers.LonLat(0, 0),
2);</div>
<div> </div>
<div> map.div.oncontextmenu = function
noContextMenu(e) {</div>
<div> var lonlat = map.getLonLatFromPixel(new
OpenLayers.Pixel(e.layerX, e.layerY));</div>
<div> $("#lat").val(lonlat.lon);</div>
<div> $("#lng").val(lonlat.lat);</div>
<div> $("#detList").dialog("open");</div>
<div> return false;</div>
<div> };</div>
<div> </div>
<div> var renderer =
OpenLayers.Util.getParameters(window.location.href).renderer;</div>
<div> renderer = (renderer) ? [renderer] :
OpenLayers.Layer.Vector.prototype.renderers; </div>
<div> </div>
<div> markers = new
OpenLayers.Layer.Vector("Markers",</div>
<div> {</div>
<div> renderOptions: { yOrdering: true },</div>
<div> renderers: renderer</div>
<div> }</div>
<div> );</div>
<div> map.addLayer(markers);</div>
<div> </div>
<div> var dragFeature = new
OpenLayers.Control.DragFeature(markers);</div>
<div> dragFeature.onComplete = function (feature,
pixel) {</div>
<div> var id = feature.geometry.id;</div>
<div> id = id.replace('Det_', '');</div>
<div> </div>
<div> var lonLat =
map.getLonLatFromPixel(pixel);</div>
<div> $.post(</div>
<div> '@Url.Action( "MoveDet", "Api" )',</div>
<div> { id: id, lat: lonLat.lon, lng:
lonLat.lat }</div>
<div> );</div>
<div> }</div>
<div> map.addControl(dragFeature);</div>
<div> dragFeature.activate();</div>
<div> </div>
<div> var clickFeature = new
OpenLayers.Control.SelectFeature(markers);</div>
<div> clickFeature.handlers.feature.stopDown =
false;</div>
<div> clickFeature.onSelect = function (feature) {</div>
<div> var id = feature.geometry.id;</div>
<div> id = id.replace('Det_', '');</div>
<div> $.post('@Url.Action("GetDetectorById",
"Api")',</div>
<div> { detId: id },</div>
<div> function (data) {</div>
<div> if (data.Id != null) {</div>
<div> clickedMarker = feature;</div>
<div> $("#lat").val(data.X);</div>
<div> $("#lng").val(data.Y);</div>
<div> OpenDetector(data.Id,
data.InTest, data.InService, data.Name);</div>
<div> } else {</div>
<div> alert(data);</div>
<div> }</div>
<div> }</div>
<div> );</div>
<div> }</div>
<div> </div>
<div> map.addControl(clickFeature);</div>
<div> clickFeature.activate();</div>
<div> }</div>
<div> </div>
<div> function SetMarkerIcon(det, type) {</div>
<div> var lat = parseFloat(det.Lat);</div>
<div> var lng = parseFloat(det.Lng);</div>
<div> var id = "";</div>
<div> if (type != "optical") {</div>
<div> id = "fire_" + det.Id;</div>
<div> } else {</div>
<div> id = "detIcon_" + det.Id;</div>
<div> }</div>
<div> </div>
<div> var marker = new
OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point(lat, lng));</div>
<div> marker.style = {</div>
<div> externalGraphic:
'@Url.Content("~/Images/Icons/Optical.png")',</div>
<div> graphicOpacity: 1.0,</div>
<div> graphicWidth: 30,</div>
<div> graphicHeight: 30,</div>
<div> graphicYOffset: -15,</div>
<div> graphicXOffset: -15,</div>
<div> cursor: 'pointer',</div>
<div> </div>
<div> backgroundGraphic:
'@Url.Content("~/Images/Icons/Optical_Shadow.png")',</div>
<div> backgroundXOffset: -12,</div>
<div> backgroundYOffset: -12,</div>
<div> </div>
<div> graphicZIndex: 11,</div>
<div> backgroundGraphicZIndex: 10</div>
<div> }</div>
<div> marker.url = '@Url.Action("MoveDet", "Api")';</div>
<div> marker.geometry.id = "Det_" + det.Id;</div>
<div> markers.addFeatures(marker); </div>
<div> }</div>
<div> </div>
<div> $(document).ready(function () {</div>
<div> init();</div>
<div> });</div>
<div> </div>
<div></script></div>
<div> </div>
<div><font face="Calibri" size="3">greetings</font></div>
<div><font face="Calibri" size="3">Ruben</font></div>
<div> </div>
<div style="BACKGROUND: #f5f5f5">
<div style="font-color: black"><b>From:</b> <a
moz-do-not-send="true" title="adube@mapgears.com"
href="mailto:adube@mapgears.com">Alexandre Dubé</a>
</div>
<div><b>Sent:</b> Friday, August 17, 2012 2:53 PM</div>
<div><b>To:</b> <a moz-do-not-send="true"
title="openlayers-users@lists.osgeo.org"
href="mailto:openlayers-users@lists.osgeo.org">openlayers-users@lists.osgeo.org</a>
</div>
<div><b>Subject:</b> Re: [OpenLayers-Users]
SelectFeature and navigation</div>
</div>
</div>
<div> </div>
</div>
<div style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY:
'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT:
normal; TEXT-DECORATION: none">
<div class="moz-cite-prefix">Hi Ruben,<br>
<br>
Would you please provide more details, like a live short
demo showing the issue or paste some code ? The
SelectFeature control doesn't deactivates itself after a
pan or zoom, so we need to find out why it does in your
case.<br>
<br>
To help you find out what the issue is, you can minimize
your code step by step. This nice article mentions a lot
about this, I'd suggest you read it first :<br>
<a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://docs.openlayers.org/help/minimize.html">http://docs.openlayers.org/help/minimize.html</a><br>
<br>
Best regards,<br>
<br>
Alexandre<br>
<br>
<br>
On 12-08-17 04:27 AM, <a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:ontwerp@limotec.be">ontwerp@limotec.be</a>
wrote:<br>
</div>
<blockquote
cite="mid:7E7EA4AA322E4F38BFA5BD78582E305E@OntwerpPC021"
type="cite">
<div dir="ltr">
<div style="FONT-FAMILY: 'Calibri'; COLOR: #000000;
FONT-SIZE: 12pt">
<div>
<div style="FONT-STYLE: normal; DISPLAY: inline;
FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE:
small; FONT-WEIGHT: normal; TEXT-DECORATION: none">Hello</div>
<div dir="ltr">
<div style="FONT-FAMILY: 'Calibri'; COLOR:
#000000; FONT-SIZE: 12pt">
<div style="FONT-FAMILY: ; COLOR: ">
<div> </div>
<div>When the map is loaded the selectfeature
works, but after a pan or zoom it doesn’t.
It seems that the selectfeature is
deactivated after pan or zoom.</div>
<div>Is there a way to reactivate the
selectfeature after a pan or zoom?</div>
<div> </div>
<div>greetings</div>
<div>Ruben</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Alexandre Dubé
Mapgears
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.mapgears.com">www.mapgears.com</a>
</pre>
<p>
</p>
<hr>
_______________________________________________<br>
Users mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</div>
</div>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Alexandre Dubé
Mapgears
<a class="moz-txt-link-abbreviated" href="http://www.mapgears.com">www.mapgears.com</a>
</pre>
</body>
</html>