The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Object Methods

new()

Returns a new Wap object. NOTE: this method may take some time to execute as it loads the list into memory at construction time

hasLibrary()

Params: none Returns: true if library exists Example: if($obj->hasLibrary) { # do something here }

initializeMap()

Params: none Returns: none Example: $obj->initializeMap

newMap()

create a new empty map Params: none Returns: none Example: $obj->newMap;

loadMap($file)

Open an existing map Params: -string map file to load Returns: none croaks on failure Example: $obj->loadMap($file

showMap()

Makes the map visible on screen Params: none Returns: none Example: $obj->showMap

saveMap([$filename])

If a filename is passed in, it gets saved as such, otherwise it is the same as using File-->Save Params: optional filename to save the map as Returns: none Example: $obj->saveMap; # save the map to file x $obj->saveMap($x);

setSaveFlag()

Toggle the save flag on the map, doing so will make mappoint not prompt on exit to save the current map Params: none Returns: none Example: $obj->setSaveFlag

selectItem($item)

Transparent call to select on the come object

Params: object An object retrieved from a create/load/get call in this library Returns: none Example: my $pushpin = $obj->addPushPin("pin name"); $obj->selectItem($pushpin);

addPushpinSet($name)

If the set already exits this method will return the existing set Params: -string name of this pushpinset Returns: the created pushpinset Example: my $set = $obj->addPushPinSet("test set");

gotoPushpinSet($myset)

This will cause the activemap to zoom to the given pushpin set Params: object - A pushpinset retrieved with get or add Returns: none Example: $obj->gotoPushpinSet($myset);

getPushpinSet($name)

Params: string Name of the set Returns: the set if found Example: $obj->getPushpinSet("bogus");

delPushpinSet()

Params: string Name of pushpin set Returns: none Example: $obj->delPushpinSet("Bogus");

addSymbol($name,$file)

Params: -string Name of symbol -string File to load symbol from (windows icon file) Returns: symbol id or 0 Example: $obj->addSymbol("goodStrength",$file);

hasSymbol($symbolname)

Params: -string name of the symbol Returns: true if symbol exists Example: if($obj->hasSymbol($sym) { # do something here }

delSymbol($sym)

Params: -stirng name of symbol to delete Returns: none Example: $obj->delSymbol("test");

getLocation($lon,$lat,[$alt])

numbers need to be in std GIS format i.e. N 86.0000 should be 86.00000 S 86.0000 should be -86.0000 E 37.0000 should be 37.00000 W 37.0000 should be -37.0000

Params: -double Longitude -double Latitude -double Altitude [Optional] Returns: location object if the location is valid or undef Example: $loc = $obj->getLocation(23.000000,56.000000,50);

gotoLocation($locationObject)

Params: -object a Location object Returns: none Example: $obj->gotoLocation($loc);

addPushpin($locationObject,[$title])

Params: -object a Location object -string Title [Optional] Returns: Pushpin Object Example: $obj->addPushPin($loc,"my pin"); $obj->addPushPin($loc); # willl create the pin with a title of No-Title

findPushpin($title)

Find a pushpin by title Params: -string Title Returns: Pushpin Object Example: my $pin = $obj->findPushPin($loc,"my pin");

setPushpinProperty($pushpinObject,$property,$value)

For a reference to pushpin properties see MSDN Params: -object a PushPin object -string Property -any Value Returns: none Example: $obj->setPushPinProperty($pin,"Symbol","1"); # set the pin symbol to 1 $obj->setPushPinProperty($pin,"Location",$loc); # set the pin location to $loc

getPushpinProperty($pushpinObject,$property)

For a reference to pushpin properties see MSDN Params: -object a PushPin object -string Property Returns: the associated value Example: $obj->getPushPinProperty($pin,"Symbol"); # get the pin symbol

addPushpinToSet($pushpinObject,$pushpinSet)

Params: -object a PushPin object -object a PushPinSet Object Returns: none Example: $obj->addPushPinToSet($pin,$set); # set the pin symbol to 1

delPushpin($title)

Params: -string Title of pushpin Returns: none Example: $obj->delPushpin("bogus");

findCity($city)

Params: -string City in form of "City, State" Returns: location object if the city is found Example: my $location - $obj->findCity("Atlanta, GA");

NAME

NetStumbler::MapPoint - MapPoint tools for NetStumbler

SYNOPSIS

  use NetStumbler::MapPoint;
  my $maplib = NetStumbler::MapPoint->new();
  $maplib->newMap();
  $maplib->showMap();

DESCRIPTION

 This module handles interaction with Microsoft MapPoint libraries
 as I find a map libraries for use on linux/mac I will add support for those
 this module is fail fast, meaning if you dont have mappoint the method call do
 nothing and do not throw errors

EXPORT

These functions avaibale for export hasLibrary initializeMap newMap loadMap showMap saveMap addPushpinSet getPushpinSet delPushpinSet gotoPushpinSet addSymbol delSymbol getLocation gotoLocation addPushpin findPushpin setPushpinProperty addPushpinToSet delPushpin setSaveFlag selectItem findCity

SEE ALSO

Win32API and MSDN For MapPoint API examples

AUTHOR

Salvatore E. ScottoDiLuzio<lt>washu@olypmus.net<gt>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Salvatore ScottoDiLuzio

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.