Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 6 of 6

Programmatically delete Imported Custom Symbols

This is a discussion on Programmatically delete Imported Custom Symbols within the MapPoint Desktop Discussion forums, part of the Map Forums category; I was wondering if anyone know how to programmatically delete imported custom symbols. TIA...

  1. #1
    Kevin_Williams is offline Junior Member Yellow Belt
    Join Date
    Nov 2006
    Posts
    20

    Programmatically delete Imported Custom Symbols

    I was wondering if anyone know how to programmatically delete imported custom symbols.
    TIA

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Programmatically delete Imported Custom Symbols

    Hi Kevin,

    I mostly do all from within programming, then you have all in control of course. I never tryed it, but if you import with the MapPoint user interface it is probably the same. You can give (I think) each pushpin an exclusive name. Then you can find the pushpin with FindPushpin(name) and eventually delete it.

    Of course if you do the import from within your application you can keep a linked list to all imported data.

  3. #3
    Kevin_Williams is offline Junior Member Yellow Belt
    Join Date
    Nov 2006
    Posts
    20

    Re: Programmatically delete Imported Custom Symbols

    I think this might work, but I still need to code it and test it.

    Adding the Symbol into MapPoint is done like this:
    Code:
    axMappointControl.ActiveMap.Symbols.Add(filePath)
    I'm thinking the Symbol can be deleted by the following:
    Code:
    MapPoint.Symbol symbol = axMappointControl.ActiveMap.Symbols.ItemByID(symbolID);
    symbol.Delete();

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Programmatically delete Imported Custom Symbols

    Hi Kevin,

    Yes this will work. Sorry I did completely misundersteand your original question.

  5. #5
    Kevin_Williams is offline Junior Member Yellow Belt
    Join Date
    Nov 2006
    Posts
    20

    Re: Programmatically delete Imported Custom Symbols

    i improved the code so it doesn't take as long to delete the imported symbols.

    pretty much we use a collection to help manage the imported symbols.

    when we add the symbol:
    Code:
    MapPoint.Symbol symbol = axMappointControl.ActiveMap.Symbols.Add(fileName);
    symbol.Name = fileName;
    arrayList.Add(fileName);
    when we add the symbol, symbol name does not contain the extension.
    so we would have to set the symbol name to file name.

    when we delete:
    Code:
    object objSymbol = fileName;
    MapPoint.Symbol symbol = axMappointControl.ActiveMap.Symbols.get_Item(ref objSymbol);
    symbol.Delete();
    arrayList.Remove(fileName);
    note: the reason why i'm using symbol name instead of symbol ID is because the user will be able to add and delete the imported symbol on their own. so the symbol ID may be referring to another symbol.
    Last edited by Kevin_Williams; 02-08-2007 at 06:34 PM.

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Programmatically delete Imported Custom Symbols

    Hi Kevin,

    Thanks for feedback. Yes it is always a good idea to keep yourself a collection / array / linked list. And normally it is faster also.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom symbols
    By Il Rex in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 07-17-2011, 10:06 AM
  2. Creating Custom puspin symbols
    By hegdek in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-30-2006, 01:38 AM
  3. Custom Maps imported to MapPoint
    By TomZ in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-18-2005, 04:44 PM
  4. Custom Pushpins symbols
    By mionut in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-18-2005, 11:24 AM
  5. Custom Symbols
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-20-2003, 01:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25