Commit 309a2de73503c991961ea59f1488039972f43337

  • avatar
  • arvind
  • Sat Jun 02 18:26:12 IST 2012
Annotations with no names should not be rendered, or should be treated as incomplete ones
myVector.js
(11 / 9)
  
197197 selectControl = new OpenLayers.Control.SelectFeature(box3,
198198 {onSelect: onFeatureSelect});
199199
200 MapselectControl = new OpenLayers.Control.SelectFeature(map,
201 {onSelect: onMyFeatureSelect});
202
203200 drawControls = {
204201 box : new OpenLayers.Control.DrawFeature(boxes,
205202 OpenLayers.Handler.RegularPolygon, {
206206 }
207207 }
208208 ),
209 select: selectControl,
210 mySelect: MapselectControl
209 select: selectControl
211210 };
212211 map.zoomToExtent( mapBounds );
213212 for(var key in drawControls){
214213 map.addControl(drawControls[key]);
215214 }
216215 drawControls['select'].activate();
217 drawControls['mySelect'].activate();
218216 addLabel('3759.0000','-1274.33337','Face');
219217 addLabel('3719','-1771','Jewelery');
220218 addLabel('4263.0000','-1630.33337', 'Video')
306306 favColor: 'blue',
307307 };
308308 labelFeature.attributes['name'] = prompt("Enter a name");
309 map.addLayer(vectorLayer);
310 vectorLayer.drawFeature(labelFeature);
311 vectorLayer.addFeatures([labelFeature]);
309 console.log(labelFeature.attributes['name']);
310 if(labelFeature.attributes['name'])
311 {
312 console.log("here");
313 map.addLayer(vectorLayer);
314 vectorLayer.drawFeature(labelFeature);
315 vectorLayer.addFeatures([labelFeature]);
316 }
317 else
318 myObj.feature.destroy();
312319}
313320function toggleControl(element) {
314321 for(key in drawControls) {