Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use ArcGis Javascript api 3.2. I have a symbol:

candidateSymbol=new esri.symbol.PictureMarkerSymbol('image/PushPin.png', 30, 30);

I want to center it when it is being clicked.

PS: There will be many such symbols on the map. I want to center the screen on the symbol that is being clicked.

share|improve this question
up vote 1 down vote accepted

I solved it by doing the following.

dojo.connect(, "onClick", function(evt) {         
      var g=evt.graphic.geometry;

But it is important to make sure that this part of the code is placed after the "map" is instantiated. Failing to do so will through you a js error that "map object not found".

PS: candidateSymbol was part of the graphics layer.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.