fix example, clean up duplicate files

This commit is contained in:
Mike Morris
2015-09-01 16:08:46 -04:00
parent 1c5fddab6c
commit 4694c7b51a
7 changed files with 7 additions and 132 deletions

3
.gitignore vendored
View File

@@ -34,3 +34,6 @@
/ios/benchmark/assets/tiles/mapbox.mapbox-streets-v6/
/ios/benchmark/assets/tiles/mapbox.mapbox-terrain-v2/
/ios/benchmark/assets/glyphs/DIN Offc Pro*/
/platform/node/test/actual
/platform/node/test/diff

View File

@@ -1,18 +0,0 @@
Standard: Cpp11
IndentWidth: 4
AccessModifierOffset: -4
UseTab: Never
BinPackParameters: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
AlwaysBreakTemplateDeclarations: true
NamespaceIndentation: None
PointerBindsToType: false
SpacesInParentheses: false
BreakBeforeBraces: Attach
ColumnLimit: 100
Cpp11BracedListStyle: false
SpacesBeforeTrailingComments: 1

View File

@@ -1,5 +0,0 @@
build
lib
node_modules
test/actual
test/diff

View File

@@ -1 +0,0 @@
Please run [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) and verify that code formatting will remain consistent before submitting a pull request.

View File

@@ -1,27 +0,0 @@
Copyright (c) 2014, Mapbox
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of [project] nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -1,78 +0,0 @@
BUILDTYPE ?= Release
MBGL ?= vendor/mbgl
DEBUG_FLAG =
ifeq ($(BUILDTYPE), Debug)
DEBUG_FLAG = -d
endif
ifeq ($(shell uname -s), Darwin)
HOST ?= osx
ifeq ($(JOBS),)
JOBS = $(shell sysctl -n hw.ncpu)
endif
endif
ifeq ($(shell uname -s), Linux)
HOST ?= linux
ifeq ($(JOBS),)
JOBS = $(shell nproc)
endif
endif
NODE_PRE_GYP = $(shell which node-pre-gyp)
ifeq ($(NODE_PRE_GYP),)
NODE_PRE_GYP = $(shell npm bin)/node-pre-gyp
endif
# Explicitly disable the default FileSource implementation
ASSET = none
HTTP = none
CACHE = none
include $(MBGL)/config/defaults.mk
global: build
.PHONY: build
build: build/Makefile
@$(NODE_PRE_GYP) build $(DEBUG_FLAG) --clang -- -j$(JOBS)
vendor/mbgl:
git submodule update --init
GYP_SETTINGS = -Dmbgl=$(MBGL) \
-Dhost=$(HOST) \
-I$(MBGL)/config/$(HOST).gypi \
$(LIBS_$(HOST)) \
-Duv_static_libs= -Duv_ldflags=
.PHONY: build/Makefile
build/Makefile: $(MBGL)/config/$(HOST).gypi
@$(NODE_PRE_GYP) configure --clang -- $(GYP_SETTINGS) -f make
.PHONY: build/binding.xcodeproj
build/binding.xcodeproj: $(MBGL)/config/$(HOST).gypi
@$(NODE_PRE_GYP) configure --clang -- $(GYP_SETTINGS) -f xcode
.PHONY: xproj
xproj: build/binding.xcodeproj
open build/binding.xcodeproj
$(MBGL)/config/%.gypi: $(MBGL) $(MBGL)/configure
make -C $(MBGL) config/$*.gypi geojsonvt
.PHONY: test-suite
test-suite:
-@(`npm bin`/tape test/render.test.js)
.PHONY: test-js
test-js:
@(`npm bin`/tape test/js/**/*.test.js)
.PHONY: test
test: test-js test-suite
.PHONY: clean
clean:
rm -rf build lib
rm -f $(MBGL)/config/$(HOST).gypi

View File

@@ -2,19 +2,20 @@
/* jshint node: true, unused: false */
'use strict';
var mbgl = require('..');
var mbgl = require('../../..');
var fs = require('fs');
var path = require('path');
var PNG = require('pngjs').PNG;
var base = path.join(path.dirname(process.mainModule.filename), '../test');
var base = path.join(__dirname, '../test');
var map = new mbgl.Map({
request: function(req) {
fs.readFile(path.join(base, req.url), function(err, data) {
req.respond(err, { data: data });
});
}
},
ratio: 1.0
});
map.load(require('../test/fixtures/style.json'));