Tag Info

Hot answers tagged

9

you can do with the same method: map.events.register(type, obj, listener); movestart triggered after the start of a drag, pan, or zoom move triggered after each drag, pan, or zoom moveend triggered after a drag, pan, or zoom completes zoomend triggered after a zoom completes example code: map.events.register("move", map, function() { ...


7

Do you need to synchronize only moving and zooming of map? In that case, one simple solution is: listen moveend event on map, and then zoom other map to extent of current map. map1 = new OpenLayers.Map('map1'); map2 = new OpenLayers.Map('map2'); map1.events.on({ moveend: function(evt) { map2.zoomToExtent(map1.getExtent()); } }); ...


6

In your code, you are subscribing to an event using an anonymous method delegate. When you need to unsubscribe from an event, it is generally easier and more readable to use non-anonymous methods (note this is C# 3 or higher code, C# 2 would need to be a bit more verbose): // subscribe Events.OnCreateFeature += OnCreateFeature; // unsubscribe ...


5

I had basically the same question as user506706. I just couldn't believe that the Vector layer was the only layer to handle touches...so if all else fails...read the code. In OpenLayers-2.11/OpenLayers/lib/Events.js I found: BROWSER_EVENTS: [ "mouseover", "mouseout", "mousedown", "mouseup", "mousemove", "click", "dblclick", "rightclick", ...


5

OftenThe Google layers work differently from other layer types as they are loaded through the Google API rather than OpenLayers code. The loadend issue is logged as a bug in the OpenLayers bug tracker, but its status has since been changed to a (non-completed) feature. Instead you could try capturing the tilesloaded event from the Google API, and put ...


4

It is by-passing Object Store() behavior. A "quick" (ok, laughing a bit) glance of the GeoDatabase Object Model reveals that you can optionally implement IObjectClassInfo2. try implementing that and returning FALSE for the CanByPassStoreMethod.


4

It's also possible to make the feedback instant, at the cost of complicating the code a bit (and causing potential performance problems if there are other events attached to the maps): (used user1702401's answer and Fiddle as a template - thanks) var mapFollow = function(mapA, mapB) { var syncMapHandler = function() { var aCenter = ...


4

This sample would suggest that the API already separates a single click from drag events quite well (as well as double clicks). http://developers.arcgis.com/en/javascript/samples/map_infowindow/ Would you mind posting some code or at least explaining what you're doing with your custom onclick handler?


3

Some time ago I faced the same task and have searched documentation and forums concerning this question. At last I've ended on this Esri forum topic: How to suppress AbortOperation message. I have used approach proposed in the last message of that topic although it is not very beautiful. This was in 9.3.1, may be there is better solution in 10.0 now. Hope ...


3

there is an information here about right click select feature. i havent try it but it looks like it works. myMap is OpenLayers.Map object and myVectorLayer is... OpenLayers.Layer.Vector. myMap.div.oncontextmenu = function noContextMenu(e) { if(!e){ //dear IE... var e = window.event; e.returnValue = false; } var f = ...


3

as i understand from the codes and your explanation, it's come to my mind: in OpenLayers.Popup method, there is a parameter which name is closeBox. this works for: {Boolean} Whether to display a close box inside the popup. if you make it true, the closing button will show in popup, in this case when you click to closing box, it is going to destroy all ...


3

As I understand it, you have two .NET ComboBoxes on a UserControl that implements ICommand and IToolControl, and you want to get a reference to one of the combo boxes from the other. As long as they are in the same scope you should just be able to refer to them by their variable names (check your UserControl designer for the names of your controls). If the ...


3

I'm not sure if this is the source of your problem, but I would suggest not applying the events to the mxDoc.ActiveView within the OnCreate event of the dockable window. The active view can change for a variety of reasons, (user adds a new data frame or opens a new map document). By assigning the events in the OnCreate event you are locking the event ...


3

There is nothing wrong with your code. It works fine. You are doing it right. I can select the tool, click on the map and the coordinates are displayed in the message box. To convert to map units add references to ESRI.ArcGIS.Display, ESRI.ArcGIS.Geometry and ESRI.ArcGIS.Carto and replace the OnMouseDown with this public override void OnMouseDown(int ...


3

As an example, go to http://www.openlayers.org/dev/examples/click.html Type in your console map.events.listeners to get a list of registered events classified by events types. To see if you really added your event to the map, just count the type of events you registered. A sample could be console.log('Before adding a new click event', ...


2

Copy Features uses an insert cursor to 'store' the result and hence doesnt fire OnCreateFeature. Take a look at the following help topic and follow the advice in the 'Feature events and cursors' heading if you want to listen to that event when using CopyFeatures. Responding to feature or row edits


2

See this DEMO. I've recreated your code in the DEMO and it works fine. Without the complete source it's hard to tell what is causing your problem. Your code was throwing an error and was easily fixed by doing what Vadim mentioned: "switch last 2 statements". I have a feeling it has something to do with the source of rPoly(reading from KML). Because that's ...


2

Whenever I do this sort of thing I store the layer and field names in a static property set contained in the toolbar. Then I use a document event handler to check if layers are added/removed from ArcMap or if the document is changed. The layer and field properties get updated whenever they are changed in the drop-down by the user. If the layer is removed ...


2

Rather than coding a solution, have you considered using the GPS Tracklog instead of a streaming polyline? The tracklog saves at a defined interval GPS coordinates provided the GPS is on and receiving in a shapfile and displays it in ArcPad. However it is not an edit feature, so it does not stop when yuo add a new record to your edit feature (such as your ...


2

This code should do what you need: from PyQt4.QtCore import QEvent, QObject from PyQt4.QtGui import QWheelEvent from qgis.gui import QgsMapCanvas from qgis.core import QgsMessageLog import qgis class EventHook(QObject): def eventFilter(self, object, event): if event.type() == QEvent.Wheel: QgsMessageLog.logMessage("Wheel event delta was %s" % ...


2

My first answer was apprently not working and as I am now facing the same problem here a new approach: Leaflet supports an event called contextmenu. As found in the Leaflet event documentation here. Fired when the user pushes the right mouse button on the map, prevents default browser context menu from showing if there are listeners on this event. So ...


2

Try this internal function: L.DomEvent.stopPropagation(event); It should do the trick. P.S. I never found that in any documentation but saw it used in a patch. Use at your own risk. ;) Edit: I also found this internal function L.DomEvent.preventDefault(event); Which seems to be very much the same as event.preventDefault() which is in jQuery.


2

You are registering a new mouseout event listener every time you showPopup. This itself is a memory leak and the root of your problem. Something like this will work much better: var map, wmsLayer, point, popup; function hidePopup(event){ popup.destroy(); } function showPopup(event) { popup = new OpenLayers.Popup('photo', point, null, 'popup', ...


2

Use SelectFeature to handle the clicks for individual features. Here's an example: http://openlayers.org/dev/examples/select-feature.html


2

I'm not sure about this particular command, but in general, you can intercept these sorts of things by implementing ICustomizationFilter and capturing what gets called when esriCEInvokeCommand is passed to OnCustomizeEvent. Implement the interface and register the class via IApplication.LockCustomization. Returning false for this method results in it being ...


1

Here are a couple helpful links to get you started: http://edndoc.esri.com/arcobjects/9.2/ComponentHelp/esriGeodatabase/IObjectClassEvents_Example.htm http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//002500000610000000 VB code may be converting using developerFusion site.


1

if you share your code, we can make a good point for you. addition to the moveend listener you can chek out OpenLayers.Control.DragPan method for your request. function dragged(){ console.info('map dragged'); }; var drag = new OpenLayers.Control.DragPan({'map':map, 'panMapDone':dragged}); drag.draw(); map.addControl(drag); drag.activate(); i hope ...


1

This question has been answered before on stackoverflow: http://stackoverflow.com/questions/8832029/how-to-select-a-feature-programmatically-on-a-vector-layer-in-openlayers


1

@Name - It seems the event filter is the way to go. Be careful, though, they can slow down an app, as they filter many other events. Can't help you without any code to go on. Alternatively, you could have your plugin pop up a 'zoom pad' to receive the wheeling focus. This small window, or dock widget, could be a down-and-dirty zoom-in on your selected ...


1

I had a similar problem with a custom tool. I have a custom form which gets opened by a button on an AddIn-Toolbar in ArcGis 10.x. On this form there is a button that should retreive the coordinates of a click in the map, snapping included. I could start the tool and handle the click in the map, but I could not get the value back to my form, because the cast ...



Only top voted, non community-wiki answers of a minimum length are eligible