daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Sep 20th, 2018 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. document.getElementById('map').oncontextmenu = function (e) {
  2.     e = e ? e : window.event;
  3.     if (e.preventDefault) e.preventDefault(); // For non-IE browsers.
  4.     else return false; // For IE browsers.
  5. };
  6.  
  7. var mapOptions = {
  8.     div: "map"
  9. };
  10.  
  11. map = new OpenLayers.Map('map', mapOptions);
  12. map.addLayer(new OpenLayers.Layer.OSM());
  13.  
  14. OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
  15.  
  16.     defaultHandlerOptions: {
  17.         'single': true,
  18.             'double': true,
  19.             'pixelTolerance': 0,
  20.             'stopSingle': false,
  21.             'stopDouble': false
  22.     },
  23.     handleRightClicks: true,
  24.     initialize: function (options) {
  25.         this.handlerOptions = OpenLayers.Util.extend({}, this.defaultHandlerOptions);
  26.  
  27.         OpenLayers.Control.prototype.initialize.apply(
  28.         this, arguments);
  29.         this.handler = new OpenLayers.Handler.Click(
  30.         this, this.eventMethods, this.handlerOptions);
  31.     },
  32.     CLASS_NAME: "OpenLayers.Control.Click"
  33.  
  34. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top