On 21 October 2011 03:10, ss ss <shaisoftwa...@gmail.com> wrote:
> Dear Andrew,
>                     Is there any example on the custom control you are
> suggesting? Thank you.

Well, I searched the group for "new GControl" and found a thread which
looked reasonable. And it happens to have a post of mine in it.

http://groups.google.com/group/google-maps-api/browse_thread/thread/edc5659d4849dbd

The relevant code at
http://www.achurchnearyou.com/eastbourne-christ-church/ is now at line
325 because things have changed in the meantime.

This creates a new control called legend_control, containing a table,
and adds it to the map. It then sets print and select attributes and
specifies the default position.

function legend_control() {}
legend_control.prototype = new GControl();
legend_control.prototype.initialize = function() {
   var contents = document.createElement("table");
   ...
   document.getElementById('map_canvas').appendChild(contents);
   return contents;
   }
legend_control.prototype.printable=function(){return true};
legend_control.prototype.selectable=function(){return true};
legend_control.prototype.getDefaultPosition=function(){
   return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(4,25))
   }

If you don't need a table, you could probably simply create your form
element in the control. I can't remember whether I tried using
innerHTML to make it easy; but I seem to remember that the only way to
get it to work was to build the DOM by hand.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to