I have created labels ,legends scale and North-direction pointer but I now need to conditionally hide or show the points using button in mapbasic program but I don't know the syntax.

Where can I find syntax examples to interact with map window?

I want to change current view in mapinfo window and plot map using values from same table but using certain condition.Any Example. My Code:

Open Table "geoLocation.TAB" Interactive
Map From geoLocation
select * from geoLocation where vendor = "V1" into selection

Now I want to redraw this selection in same map window but when i do :

Map From Selection

It draws in new window.How to avoid this and is my way correct way ?

1 Answer 1


The MapBasic Referencce is a good start to find out all the different Functions existing in MapBasic, you find it here: http://www.pbinsight.com/support/product-documentation/details/mapinfo-mapbasic

Regarding your problem you should do: select * from geoLocation where vendor = "V1" into geolocation_selected (into selection is unneccesary because it is default) and then add geoLocation_selection to the map.

  • add statement creates new layer so if same statement is run it creates multiple layers. Is there any way to avoid this?
    – kinkajou
    Commented Jul 3, 2011 at 22:46
  • Can you not remove the query layer from the map window before you rerun the query? Then you can add the query to the map window again once you have rerun the query.
    – James S
    Commented Jul 4, 2011 at 7:51
  • Oh I could not get it query layer means code with query. Is there any example. Actually I jut want to show hide point not select it.
    – kinkajou
    Commented Jul 4, 2011 at 9:13
  • 1
    You can undisplay each object in the layer but it,s easier to create another layer. You can check if the layer is already part of the map. You get the name with LayerInfo(Window_id, layer_id,LAYER_INFO_NAME). Remove it and add the new layer from the query. Commented Jul 5, 2011 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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