Hot answers tagged

13

GIS Day is a perfect day to promote GIS within your organisation. Setup something fun - showcase videos like GeoSpatial Revolution or if your in local government, try to woo the people with the budget strings with a video on the role of GIS in Government 2.0 I think its all about showing the non-GIS people in where you work, the potential on what can be ...


11

geocache party / treasure hunt, where the treasure is booz and pizza


10

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() { ...


9

I have written down a small piece of code might be helpful for you. You can try working example on jsFiddle <!DOCTYPE html> <html> <head> <title>Leaflet - Marker Click Event</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="http://...


8

GIS is everyday in mapperz world...


8

Assuming you use an ol.layer.Vector with an ol.source.GeoJSON you can use something like this: var vectorSource = new ol.source.GeoJSON({ projection : 'EPSG:3857', url: 'http://examples.org/fearures.json' }); var vectorLayer = new ol.layer.Vector({ source: vectorSource }); map.addLayer(vectorLayer); // show loading icon // ... var listenerKey = ...


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 Events....


6

Have you investigated Spatial Joins?


6

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", "...


6

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 = ...


5

Here's a simple way to get the coordinates of points as you draw them: // Pass these options to the DrawFeature constructor: var drawOptions = { callbacks : { "done": doneHandler, "point": pointHandler }, }; drawControls = { point: new OpenLayers.Control.DrawFeature(pointLayer, OpenLayers.Handler.Point), line: new OpenLayers....


5

Correct, the mousedown events do not occur on mobile with Touch events. Instead, you should use a Vector layer -- the Vector layers appropriately handle 'taps' and interpret them as select events.


5

We host a poster contest where all of our GIS staff (although the contest is open to anyone) each make one poster showcasing a GIS project they did in the past year that added value, solved a problem, etc. within our company. Of course we do live demos of our web apps and use the event as an evangelistic opportunity. The posters are voted on by all of the ...


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 ...


5

You can check this link and view page source: Events Example I think it has exactly what you want. function mapBaseLayerChanged(event) { log(event.type + " " + event.layer.name); } map = new OpenLayers.Map('map', { eventListeners: { "moveend": mapEvent, "zoomend": mapEvent, "changelayer": mapLayerChanged, ...


5

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?


5

Just a little CSS workaround will do the job for you. You can see the result in the following fiddle: http://jsfiddle.net/GFarkas/kkwgc1nh/ I made all of the images irresponsible to pointer events, so the clicks will fall through them and will activate the popup contents of the GeoJSON layer. The CSS code is: img.leaflet-tile{ pointer-events: none; } ...


5

In ol3 version 3.10.0 things have changed. So is more clear than older versions but still more complicated than ol2. So for TILE (ol.layer.Tile) layers your code snip should look like: //declare the layer var osmLayer = new ol.layer.Tile({ source: new ol.source.OSM() }); //asign the listeners on the source of tile layer osmLayer.getSource().on('...


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

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 ...


4

You could possibly do this with nested cursors and selection statements in Python. Something like the following, perhaps? polygons = arcpy.UpdateCursor(yourIntersectionsLayer) for row in polygons: arcpy.management.SelectLayerByAttribute(yourIntersectionsLayer,"NEW_SELECTION","\"ObjectID\" = "+str(row.ObjectID)) #you now have one ...


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 = mapA....


4

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 ...


4

I think creating event on layers(polygon layers) will work. layer_name.on('dblclick', function(e) { a = map.getZoom(); map.setZoom(a + 1);})


4

Either what @poshan has written, or add this line to onEachFeature(feature, layer): if( layer.options ) layer.options.clickable = false;


4

If you need a modifyend event why dont you use it within the modify interaction.(I guess you use a modify interaction) check this modify.on('modifyend',function(e){ console.log("feature id is",e.features.getArray()[0].getId()); }); This event is available in the latest versions of ol3. In my code snip, I assume you only modify one fetaure at once (...


4

I'm not sure what you want to do exactly, but it looks like you want to receive an event when a layer is added to, or deleted from the map, right? Here's a sample: private IActiveViewEvents_Event _avEvents; private void SetupEventHandler() { var mxDoc = (IMxDocument)ArcMap.Application.Document; _avEvents = (IActiveViewEvents_Event)mxDoc.FocusMap; ...


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 ...



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