Hi there i have following code :

vlayer = new OpenLayers.Layer.Vector("Overlay");
map.addLayer(vlayer);
var panel = new OpenLayers.Control.Panel({
    createControlMarkup: function (control) {
        var button = document.createElement('button'),
            iconSpan = document.createElement('span'),
            textSpan = document.createElement('span');
        button.setAttribute("class", "controlButtons");
        iconSpan.innerHTML = ' ';
        button.appendChild(iconSpan);
        if (control.text) {
            textSpan.innerHTML = control.text;
        }
        button.appendChild(textSpan);
        return button;
    }
});

and i am trying call a seperate functions on clicking the button...

panel.addControls([
     button1 = new OpenLayers.Control.SelectFeature(vlayer, {
     title: 'Add the company',
     text: 'Add',
     onClick: addCom,
     }),
     button2 = new OpenLayers.Control.SelectFeature(vlayer, {
         title: "Edit the company",
         text: "Edit",
         onClick: editComp,
     }),
     button2 = new OpenLayers.Control.SelectFeature(vlayer, {
         title: "Delete the company",
         text: "Delete",
         onClick: delComp,
     })]);

     map.addControl(panel);

the buttons are displaying but for some reason they are responding to click.....Please help me to sole this ...Thank YOu

asked 16 Oct '12, 15:08

Dominc's gravatar image

Dominc
31336
accept rate: 0%

edited 16 Oct '12, 15:25

SomeoneElse's gravatar image

SomeoneElse ♦
36.0k71366854

If you look through the previous openlayers questions asked here, you'll see links to more relevant help sites. Openlayers isn't actually part of OSM, so it isn't really on-topic for this help site.

There are a bunch of OpenLayers mailing lists described here, and other useful resources, including an IRC channel, here.

(16 Oct '12, 15:29) SomeoneElse ♦

thanks ......

(16 Oct '12, 15:37) Dominc
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×122

question asked: 16 Oct '12, 15:08

question was seen: 8,178 times

last updated: 16 Oct '12, 15:37

powered by OSQA