GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ManagerOrganization/FSInteractiveMap: A charting library to visualize and interact with a vector map on iOS. It's like Geochart but for iOS!

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
FSInteractiveMap.xcodeproj
FSInteractiveMap.xcodeproj
 
 
FSInteractiveMap
FSInteractiveMap
 
 
FSInteractiveMapTests
FSInteractiveMapTests
 
 
Screenshots
Screenshots
 
 
.gitignore
.gitignore
 
 
FSInteractiveMap.podspec
FSInteractiveMap.podspec
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

FSInteractiveMap

A charting library to visualize data on a map. It's like geochart but for iOS!

The idea behind this library is to load a SVG file of a map and display it simply in a view. On top of that you can know when a specific area is clicked.

Please note that the SVG loading is quite simple and doesn't support all the features of the SVG file format. It's just good enough to display most of the maps I found in SVG!

Screenshots

  

Installing FSInteractiveMap

Add the contents of the FSInteractiveMap project to your directory or simply add the following line to your Podfile:

pod "FSInteractiveMap"

How to use

FSInteractiveMap is a subclass of UIView so it can be added as regular view. It's basically loading a map from a SVG file. I bundled a few svg maps in the example but you can add any SVG to your project and load it.

NSDictionary* data = @{	@"asia" : @12,
                        @"australia" : @2,
                        @"north_america" : @5,
                        @"south_america" : @14,
                        @"africa" : @5,
                        @"europe" : @20
                      };
    
FSInteractiveMapView* map = [[FSInteractiveMapView alloc] initWithFrame:self.view.frame];

[map loadMap:@"world-continents-low" withData:data colorAxis:@[[UIColor lightGrayColor], [UIColor darkGrayColor]]];

[map setClickHandler:^(NSString* identifier, CAShapeLayer* layer) {
    self.detailDescriptionLabel.text = [NSString stringWithFormat:@"Continent clicked: %@", identifier];
}];

An example of a "clickable" map:

FSInteractiveMapView* map = [[FSInteractiveMapView alloc] initWithFrame:CGRectMake(16, 96, self.view.frame.size.width - 32, 500)];
[map loadMap:@"usa-low" withColors:nil];

[map setClickHandler:^(NSString* identifier, CAShapeLayer* layer) {
    if(_oldClickedLayer) {
        _oldClickedLayer.zPosition = 0;
        _oldClickedLayer.shadowOpacity = 0;
    }
    
    _oldClickedLayer = layer;
    
    // We set a simple effect on the layer clicked to highlight it
    layer.zPosition = 10;
    layer.shadowOpacity = 0.5;
    layer.shadowColor = [UIColor blackColor].CGColor;
    layer.shadowRadius = 5;
    layer.shadowOffset = CGSizeMake(0, 0);
}];

How to find SVG maps

There are a few places where you can find svg files that are suitable for FSInteractiveMap. Here is a short list:

  • http://www.amcharts.com/svg-maps/
  • http://www.highcharts.com/maps/demo#custom/world-continents
  • Wikipedia

Contact & Issues

If you have any issues please let me know in the issue part of this project. For any other things you can reach me on twitter or by email.

About

A charting library to visualize and interact with a vector map on iOS. It's like Geochart but for iOS!

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

1 star

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.