Latest 0.1.2
Homepage https://github.com/ebermudezcds/iOS-Density-Map
License MIT
Platforms ios 8.0, requires ARC
Authors

iOS Density Map

Version
License
Platform
Build Status

By using OpenGL ES, iOS Density Map allows you to efficiently render thousands of particles over a map.

iOS Density Map has two main components:

GLParticlesRender: Renders all the particles in a eaglcontext. Basically it renders groups of particles with a specific style (GLParticleStyle).

GLDensityMapView: Provides the eaglcontext and the particles groups info for the GLParticlesRender. The GLDensityMapView provides a number of properties and blocks that needs to be overwritten in order to display the particles.

Installation

iOS-Density-Map is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'iOS-Density-Map'

Then import the GLDensityMap.h header file:

#import <GLDensityMap.h>

Usage

- (void)setupDensityMapView{

    //Set the number of particles styles (style groups).
    self.densityMapView.styleGroupsCount = 1;

    //Returns the `GLParticleStyle` for each group.
    self.densityMapView.styleForStyleGroup = ^GLParticleStyle(GLStyleGroupIndex groupIndex) {
        GLParticleStyle style = {
            .radius = 7,
            .blurFactor = 0.95,
            .r = 255,
            .g = 130,
            .b = 0,
            .opacity = 0.45,
        };
        return style;
    };

    __weak ViewController *wself = self;

    //Returns the number of particles for each group.
    self.densityMapView.particlesCountForStyleGroup = ^uint(GLStyleGroupIndex groupIndex) {
        return (int)wself.locations.count;
    };

    //Retruns the x,y position for each particle
    self.densityMapView.positionForParticle = ^CGPoint(GLParticleIndex pointIndex, GLStyleGroupIndex groupIndex) {
        return  [wself.mapView convertCoordinate:wself.locations[pointIndex].coordinate
                                   toPointToView:wself.view];
    };
}

Example

iOS-Density-Map

Author

Enrique Bermúdez, [email protected]

License

iOS Density Map is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "iOS-Density-Map",
    "version": "0.1.2",
    "summary": "iOS Density Map allows you to efficiently render thousands of points on a map.",
    "description": "By using OpenGL ES, iOS Density Map allows you to efficiently render thousands of particles over a map.",
    "homepage": "https://github.com/ebermudezcds/iOS-Density-Map",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ebermudezcds": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ebermudezcds/iOS-Density-Map.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "GLDensityMap/**/*.{h,m}",
    "resources": "GLDensityMap/shaders.bundle"
}

Pin It on Pinterest

Share This