I am using MIT's exhibit to handle my data, it has a custom function
that gives me more control over the google map.  I can't for the life
of me get the einsert to work with it. I suspect its something about
the zindex but could use some help.

a typical exhibit map..  
http://simile.mit.edu/exhibit/examples/presidents/presidents.html

the function

//<script type="text/javascript"> omitted for post

// EInsert.js
//
//   This Javascript is provided by Mike Williams
//   Blackpool Community Church Javascript Team
//   http://www.commchurch.freeserve.co.uk/
//   http://econym.googlepages.com/index.htm
//
//   This work is licenced under a Creative Commons Licence
//   http://creativecommons.org/licenses/by/2.0/uk/

    function EInsert(point, image, size, basezoom, zindex) {
        this.point = point;
        this.image = image;
        this.size = size;
        this.basezoom = basezoom;
        this.zindex=zindex||0;
        // Is this IE, if so we need to use AlphaImageLoader
        var agent = navigator.userAgent.toLowerCase();

        if ((agent.indexOf("msie") > -1) && (agent.indexOf("opera") <
1)){this.ie = true} else {this.ie = false}
        this.hidden = false;
      }

      EInsert.prototype = new GOverlay();

      EInsert.prototype.initialize = function(map) {
        var div = document.createElement("div");
        div.style.position = "absolute";
        div.style.zIndex=this.zindex;
        if (this.zindex < 0) {
           map.getPane(G_MAP_MAP_PANE).appendChild(div);
        } else {
           map.getPane(1).appendChild(div);
        }
        this.map_ = map;
        this.div_ = div;
      }

      EInsert.prototype.makeDraggable = function() {
        this.dragZoom_ = this.map_.getZoom();
        this.dragObject = new GDraggableObject(this.div_);

        this.dragObject.parent = this;

        GEvent.addListener(this.dragObject, "dragstart", function() {
          this.parent.left=this.left;
          this.parent.top=this.top;
        });


        GEvent.addListener(this.dragObject, "dragend", function() {
          var pixels = this.parent.map_.fromLatLngToDivPixel
(this.parent.point);
          var newpixels = new GPoint(pixels.x + this.left -
this.parent.left, pixels.y +this.top -this.parent.top);
          this.parent.point = this.parent.map_.fromDivPixelToLatLng
(newpixels);
          this.parent.redraw(true);
          GEvent.trigger(this.parent, "dragend", this.parent.point);
        });
      }

      EInsert.prototype.remove = function() {
        this.div_.parentNode.removeChild(this.div_);
      }

      EInsert.prototype.copy = function() {
        return new EInsert(this.point, this.image, this.size,
this.basezoom);
      }

      EInsert.prototype.redraw = function(force) {
       if (force) {
        var p = this.map_.fromLatLngToDivPixel(this.point);
        var z = this.map_.getZoom();
        var scale = Math.pow(2,(z - this.basezoom));
        var h=this.size.height * scale;
        var w=this.size.width * scale;

        this.div_.style.left = (p.x - w/2) + "px";
        this.div_.style.top = (p.y - h/2) + "px";

        if (this.ie) {
          var loader =
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader
(src='"+this.image+"', sizingMethod='scale');";
          this.div_.innerHTML = '<div style="height:' +h+ 'px;
width:'+w+'px; ' +loader+ '" ></div>';
        } else {
          this.div_.innerHTML = '<img src="' +this.image+ '"  width='+w
+' height='+h+' >';
        }

        // Only draggable if current zoom = the initial zoom
        if (this.dragObject) {
          if (z != this.dragZoom_) {this.dragObject.disable();}
        }

       }
      }

      EInsert.prototype.show = function() {
        this.div_.style.display="";
        this.hidden = false;
      }

      EInsert.prototype.hide = function() {
        this.div_.style.display="none";
        this.hidden = true;
      }

      EInsert.prototype.getPoint = function() {
        return this.point;
      }

      EInsert.prototype.supportsHide = function() {
        return true;
      }

      EInsert.prototype.isHidden = function() {
        return this.hidden;
      }

      EInsert.prototype.setPoint = function(a) {
        this.point = a;
        this.redraw(true);
      }

      EInsert.prototype.setImage = function(a) {
        this.image = a;
        this.redraw(true);
      }

      EInsert.prototype.setZindex = function(a) {
        this.div_.style.zIndex=a;
      }

      EInsert.prototype.setSize = function(a) {
        this.size = a;
        this.redraw(true);
      }

      EInsert.groundOverlay = function(image, bounds, zIndex, proj,z)
{
        var proj = proj||G_NORMAL_MAP.getProjection();
        var z = z||17;
        var sw = proj.fromLatLngToPixel(bounds.getSouthWest(),z);
        var ne = proj.fromLatLngToPixel(bounds.getNorthEast(),z);
        var cPixel = new GPoint((sw.x+ne.x)/2, (sw.y+ne.y)/2);
        var c = proj.fromPixelToLatLng(cPixel,z);
        var s = new GSize(ne.x-sw.x, sw.y-ne.y);
        return new EInsert(c, image, s, z, zIndex);
      }

function myMapConstructor(div) {
      var map = new GMap2(div);
      var insert1 = new EInsert(new GLatLng
(32.88659234189047,-83.76044690608978), "site_cutter.jpg", new GSize
(345,527), 17);
       map.setCenter(new GLatLng(32.88659234189047,-83.76044690608978),
18);
      map.addControl(new GLargeMapControl());
      map.enableScrollWheelZoom();
      map.setMapType(G_SATELLITE_MAP);
        map.addOverlay(insert1);

        return map;

       }


//</script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to