Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V8 circle #1286

Closed
wants to merge 77 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
088806d
Updated docs/_layouts/default.html
samanpwbb Mar 16, 2015
5fa806d
Updated docs/_layouts/default.html
tatsvc Mar 17, 2015
b5402a4
update for current behavior
incanus Mar 30, 2015
94d44ba
be clearer about what's happening in the regex
incanus Mar 30, 2015
a0fc8e4
Updated docs/_layouts/default.html
tatsvc Apr 8, 2015
311d54e
Updated docs/_layouts/default.html
katydecorah Apr 9, 2015
cf21647
Add fitBounds and mouse latlng examples
tmcw Apr 16, 2015
278c973
Updated docs/_layouts/default.html
katydecorah Apr 16, 2015
afe8fea
Add flyTo with flyOptions example
tmcw Apr 16, 2015
9840d6a
Remove latlng example, refs #1171
tmcw Apr 20, 2015
e241803
Updated docs/_layouts/default.html
katydecorah Apr 21, 2015
ba2a001
Updated docs/_layouts/default.html
katydecorah Apr 22, 2015
a0606cc
Add popup examples. Fixes #325
tmcw Apr 23, 2015
d8324e0
Updated docs/_layouts/default.html
katydecorah Apr 29, 2015
a9cd133
Updated docs/_layouts/default.html
samanpwbb May 8, 2015
18561c0
Merge branch 'mb-pages'
jfirebaugh May 27, 2015
443640e
Rationalize map view method options
jfirebaugh May 25, 2015
ea7a0af
tape ⇢ prova
jfirebaugh May 27, 2015
32fa40d
Fix render tests, pin test-suite to a hash
jfirebaugh May 27, 2015
087105a
Rename Easings ⇢ Camera
jfirebaugh May 27, 2015
cca688a
Consolidate camera methods
jfirebaugh May 27, 2015
7fc51c0
Use same @typedef style
jfirebaugh May 27, 2015
fcbb550
Organize methods
jfirebaugh May 27, 2015
8dbff46
Eliminate _move
jfirebaugh May 27, 2015
680a824
Break a few more Camera ⇢ Map dependencies
jfirebaugh May 27, 2015
ccb306f
Test Camera independently of Map
jfirebaugh May 27, 2015
673190c
Fix easeTo with pitch
jfirebaugh May 27, 2015
33363a2
Use a DOM hierarchy that supports evented overlays
jfirebaugh May 27, 2015
6e99c4c
Add Map#getCanvasContainer
jfirebaugh May 27, 2015
51428a6
Don't fire spurious moveend events on mouseup (fixes #1107)
jfirebaugh May 27, 2015
8975e02
Consolidate mouse position example (fixes #1222)
jfirebaugh May 27, 2015
5276ed4
use original icon size instead of padded size
ansis May 29, 2015
e523db3
explicitly round anchor positions
ansis May 29, 2015
7f3bd7d
Expose `preserveDrawingBuffer` canvas context creation attribute to e…
vicapow May 31, 2015
88f18ac
remove extra semicolon
vicapow Jun 1, 2015
edeb488
Internal-document mru cache
tmcw Jun 1, 2015
81f708c
Improve internal documentation of actor & token
tmcw Jun 1, 2015
e00300b
Re-add st, which is used internally for tests
tmcw Jun 1, 2015
abc4b4a
Merge branch 'master' into vicapow-preserve-drawing-buffer
tmcw Jun 1, 2015
15e4749
Merge pull request #1232 from mapbox/vicapow-preserve-drawing-buffer
tmcw Jun 1, 2015
a7c8a04
Add extent support. Fixes #1227
tmcw Jun 1, 2015
598891b
Removed typedarray cache
tmcw Jun 1, 2015
9479dcf
Fix manual test
jfirebaugh Jun 1, 2015
86e18f3
Fix rendering in IE
jfirebaugh Jun 1, 2015
2adecdb
Add support for browserify
vicapow May 24, 2015
e4c92c9
rename GLPainter to Painter
ansis Jun 2, 2015
263d57c
Stub circles support
scothis Jun 2, 2015
64057fa
Merge branch 'master' into extent-support
tmcw Jun 2, 2015
229009b
Fix name for merge
tmcw Jun 2, 2015
293809b
Merge pull request #1234 from mapbox/extent-support
tmcw Jun 2, 2015
65bf3e7
Merge branch 'master' into v8-circles
tmcw Jun 2, 2015
77acaed
Add circle shaders
tmcw Jun 2, 2015
1a8e6c1
Add two triangles in the vertex buffer for each circle
tmcw Jun 3, 2015
5d68936
First steps toward drawing circles
tmcw Jun 3, 2015
21940e7
Add circlevertexbuffer and bind more data
tmcw Jun 3, 2015
f33f46a
Bind element and vertex buffer
tmcw Jun 3, 2015
66b70bc
Increment vertex and element counters
tmcw Jun 3, 2015
39b68fb
Tweak shaders: still whitescreen
tmcw Jun 3, 2015
f1fdc08
Try pointing to a_extrude. #whitescreen
tmcw Jun 4, 2015
6b9edfb
BLACK BROKEN TRIANGLE OF SUCCESS
tmcw Jun 4, 2015
2182d9e
Circle: needs placement
tmcw Jun 4, 2015
7298a89
Induce loud failure
tmcw Jun 4, 2015
cad4153
Prettier geometry access
tmcw Jun 4, 2015
24d7e0c
Fix offset value
tmcw Jun 4, 2015
6c44402
Getting closer: v_centerpoint is not being transferred
tmcw Jun 4, 2015
2692288
Implement circle blurring, hitting style spec in a second.
tmcw Jun 4, 2015
8a4670d
Pack more data into buffers, use axis-aligned boxes
tmcw Jun 4, 2015
81a9ef5
Iterate through geometries
tmcw Jun 4, 2015
b2b74f0
fix circle size
ansis Jun 8, 2015
d333d4c
Simplify derivation of v_extrude
tmcw Jun 13, 2015
498ac8e
Implement faux-antialiasing with blur
tmcw Jun 15, 2015
6d9ddef
Simplify blur calculation
tmcw Jun 15, 2015
8988dbc
Fix tile-edge clipping
tmcw Jun 15, 2015
955b5c6
Add updated debug page
tmcw Jun 15, 2015
1e202c2
Compensate for screen resolution differences when calculating min blur
tmcw Jun 16, 2015
947496e
Revert debugs to master versions
tmcw Jun 16, 2015
3cf5cfc
Merge branch 'v8' into v8-circle
tmcw Jun 16, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .zuul.yml

This file was deleted.

5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ An in-progress version being developed in the `master` branch.

* `mapboxgl.Source` is no longer exported. Use `map.addSource()` instead.
* `mapboxgl.util.supported()` moved to `mapboxgl.supported()
* map#setView(latlng, zoom, bearing) changed to map#setView(latlng, zoom, bearing, pitch)
* map#easeTo(latlng, zoom, bearing, options) changed to map#easeTo(latlng, zoom, bearing, pitch, options)
* map#setView(latlng, zoom, bearing) changed to map#jumpTo(options)
* map#easeTo(latlng, zoom, bearing, options) changed to map#easeTo(options)
* map#flyTo(latlng, zoom, bearing, options) changed to map#flyTo(options)



Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Mapbox API token from https://www.mapbox.com/account/apps/.
This command uses [mattdesl/budo](https://github.com/mattdesl/budo) to watch
source files, rebuild the browserify bundle, and trigger LiveReload updates.

Tests are written in `tape`. Most tests run within nodejs, but a few
require a browser environment.
Tests are written and run with [prova](https://github.com/azer/prova). Most
tests run within nodejs, but a few require a browser environment.

* `npm test`: local tests run in nodejs - excludes browser tests
* `npm run cov`: generate test coverage report - excludes browser tests
Expand Down
7 changes: 7 additions & 0 deletions debug/blank_v8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": 8,
"name": "rivers",
"constants": { },
"sources": { },
"layers": [ ]
}
1 change: 1 addition & 0 deletions debug/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
<script src='site.js'></script>
</body>
</html>

24 changes: 24 additions & 0 deletions debug/index_circle.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel='stylesheet' href='../dist/mapbox-gl.css' />
<style>
body { margin: 0; padding: 0; }
html, body, #map { height: 100%; }
#size { position:absolute;top:20px;left:20px; }
#blur { position:absolute;top:40px;left:20px; }
</style>
</head>

<body>
<div id='map'></div>
<input type=range id=size min=0 max=200 />
<input type=range id=blur min=0 max=1 step=0.01 />
<script src='mapbox-gl.js'></script>
<script src='site.js'></script>
</body>
</html>
1 change: 1 addition & 0 deletions debug/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ function getAccessToken() {

return accessToken;
}

70 changes: 70 additions & 0 deletions debug/site_circle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

mapboxgl.accessToken = getAccessToken();

var map = new mapboxgl.Map({
container: 'map',
zoom: 12.5,
center: [-77.066104, 38.910203].reverse(),
style: "blank_v8.json",
hash: true
});

map.addControl(new mapboxgl.Navigation());

map.on('style.load', function() {
map.addSource('geojson-point', {
"type": "geojson",
"data": {
type: 'Point',
coordinates: [-77.066104, 38.910203]
}
});
map.addLayer({
"id": "point-example",
"type": "circle",
"source": "geojson-point",
"paint": {
"circle-radius": 100,
"circle-color": '#f00',
"circle-blur": 0
}
}, 'point_circle');
});

map.on('click', function(e) {
(new mapboxgl.Popup())
.setLatLng(map.unproject(e.point))
.setHTML("<h1>Hello World!</h1>")
.addTo(map);
});

document.getElementById('size').onchange = function() {
map.setPaintProperty('point-example', 'circle-radius', this.value);
};

document.getElementById('blur').onchange = function() {
map.setPaintProperty('point-example', 'circle-blur', this.value);
};

// keyboard shortcut for comparing rendering with Mapbox GL native
document.onkeypress = function(e) {
if (e.charCode === 111 && !e.shiftKey && !e.metaKey && !e.altKey) {
var center = map.getCenter();
location.href = "mapboxgl://?center=" + center.lat + "," + center.lng + "&zoom=" + map.getZoom() + "&bearing=" + map.getBearing();
return false;
}
};

function getAccessToken() {
var match = location.search.match(/access_token=([^&\/]*)/);
var accessToken = match && match[1];

if (accessToken) {
localStorage.accessToken = accessToken;
} else {
accessToken = localStorage.accessToken;
}

return accessToken;
}

4 changes: 2 additions & 2 deletions dist/mapbox-gl.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
position: relative;
}

.mapboxgl-canvas.mapboxgl-interactive,
.mapboxgl-canvas-container.mapboxgl-interactive,
.mapboxgl-ctrl-nav-compass {
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.mapboxgl-canvas.mapboxgl-interactive:active,
.mapboxgl-canvas-container.mapboxgl-interactive:active,
.mapboxgl-ctrl-nav-compass:active {
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
Expand Down
42 changes: 25 additions & 17 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
path: /map-feedback
- title: Contact us
path: /contact
- title: Education
- title: Education
path: /education
- title: Security
path: /security
mapdesign:
- title: Mapbox Studio
path: /mapbox-studio
Expand Down Expand Up @@ -84,20 +86,26 @@
{% if page.description %}<meta name='description' content='{{page.description | strip_html}}'/>{% endif %}
<title>{% if page.title == 'Mapbox' %}{{page.title}} | Design and publish beautiful maps{% else %}{{page.title}} | Mapbox{% endif %}</title>

<meta name='st:title' content='{{page.title | replace:"'","&lsquo;" | replace:"'","&lsquo;" | replace:"| Mapbox",""}}' />
<meta name='st:type' content='{% if page.section %}{{page.section}}{% elsif page.category %}{{page.category}}{% else %}site{% endif %}' />
<meta name='st:info' content='{% if page.version %}{{page.version}}{% else %}site{% endif %}' />
<meta class='swiftype' name='title' data-type='string' content='{{page.title | replace:"'","&lsquo;" | replace:"'","&lsquo;" | replace:"| Mapbox",""}}' />
<meta class='swiftype' name='type' data-type='enum' content='{% if page.section %}{{page.section}}{% elsif page.category %}{{page.category}}{% else %}site{% endif %}' />
<meta class='swiftype' name='info' data-type='string' content='{% if page.version %}{{page.version}}{% else %}site{% endif %}' />{% if page.date and site.baseurl == '/blog' %}
<meta class='swiftype' name='published_at' data-type='date' content='{{ page.date | date_to_xmlschema }}' />{% endif %}{% if page.tags %}
{% for tags in page.tags %}<meta class='swiftype' name='tags' data-type='string' content='{{tags}}' />
{% endfor %}{% endif %}{% if page.category and page.category !='none' %}
<meta class='swiftype' name='category' data-type='string' content='{{page.category}}' />{% endif %}{% if page.author %}
<meta class='swiftype' name='author' data-type='string' content='{{page.author}}' />{% endif %}{% if page.excerpt %}
<meta class='swiftype' name='excerpt' data-type='string' content='{{ page.excerpt | strip_html | strip_newlines | replace:"'","&lsquo;" | replace:"'","&lsquo;" | truncatewords: 30 }}' />{% endif %}
{% if site.baseurl == '/mapbox.js' %}{% if site.mapboxjs != page.version and page.version != 'latest' %}<meta name='robots' content='noindex'>{% endif %}{% endif %}

{% if page.card %}
<meta name='twitter:site' content='@Mapbox' />
<meta property='og:site_name' content='Mapbox' />
<meta name='twitter:url' content='{{page.permalink}}' />
<meta property='og:url' content='{{page.permalink}}' />
<meta name='twitter:title' content='{{page.title | replace:"'","&lsquo;"}}' />
<meta property='og:title' content='{{page.title | replace:"'","&lsquo;"}}' />
<meta name='twitter:description' content='{{page.content | markdownify | strip_html | trim_spaces | truncatewords: 30 | escape | replace:"'","&lsquo;" }}' />
<meta property='og:description' content='{{page.content | markdownify | strip_html | trim_spaces | truncatewords: 30 | escape | replace:"'","&lsquo;" }}' />
<meta name='twitter:title' content='{{page.title | replace:"'","&rsquo;"}}' />
<meta property='og:title' content='{{page.title | replace:"'","&rsquo;"}}' />
<meta name='twitter:description' content='{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | replace:"'","&lsquo;" | replace:"'","&lsquo;" | truncatewords: 30 }}{% else %}{{content | markdownify | strip_html | trim_spaces | truncatewords: 30 | escape | replace:"'","&rsquo;" | replace: '&#39;',"&rsquo;" }}{% endif %}' />
<meta property='og:description' content='{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | replace:"'","&lsquo;" | replace:"'","&lsquo;" | truncatewords: 30 }}{% else %}{{content | markdownify | strip_html | trim_spaces | truncatewords: 30 | escape | replace:"'","&rsquo;" | replace: '&#39;',"&rsquo;" }}{% endif %}' />
{% if page.video %}
<meta name='twitter:card' content='player' />
<meta name='twitter:player' content='{{page.video | replace: "http:" , "https:" }}' />
Expand All @@ -116,12 +124,12 @@
{% endif %}
{% endif %}

<link href='{% if site.baseApi %}{{site.baseApi}}{% else %}https://mapbox.com{% endif %}/base/latest/base.css?v1.0' rel='stylesheet' />
<link href='{% if site.baseApi %}{{site.baseApi}}{% else %}https://www.mapbox.com{% endif %}/base/latest/base.css?v1.0' rel='stylesheet' />
<link href='{{site.url}}/css/site.css' rel='stylesheet' />
<!--[if IE 9]><link href='{{site.url}}/css/site-ie9.css' rel='stylesheet' /><![endif]-->
<link rel='shortcut icon' href='{{site.url}}/img/favicon.ico' type='image/x-icon' />
<link rel='alternate' type='application/rss+xml' title='RSS' href='{{site.url}}/blog/blog.rss' />
<link href='{% if site.mapboxjsbase %}{{site.mapboxjsbase}}{% else %}https://api.tiles.mapbox.com/mapbox.js/{% if site.mapboxjs %}{{site.mapboxjs}}{% else %}v1.6.1{% endif %}{% endif %}/mapbox.css' rel='stylesheet' />
<link href='{% if site.mapboxjsbase %}{{site.mapboxjsbase}}{% else %}https://api.tiles.mapbox.com/mapbox.js/{% if site.mapboxjs %}{{site.mapboxjs}}{% else %}v1.6.5{% endif %}{% endif %}/mapbox.css' rel='stylesheet' />

<!--[if lt IE 9 ]><script src='{{site.url}}/js/redirect-ie.js'></script><![endif]-->
<script src='https://js.stripe.com/v2/'></script>
Expand All @@ -133,7 +141,7 @@
Stripe.setPublishableKey(window.location.hostname.indexOf('mapbox.com') !== -1 ?
'pk_live_hI6mmOTIg7KkywK6vo3vJvpk' : 'pk_test_gmIyREg3sKzAiyMkAEeCsxUG');
</script>
<script src='{% if site.mapboxjsbase %}{{site.mapboxjsbase}}{% else %}https://api.tiles.mapbox.com/mapbox.js/{% if site.mapboxjs %}{{site.mapboxjs}}{% else %}v1.6.1{% endif %}{% endif %}/mapbox.js'></script>
<script src='{% if site.mapboxjsbase %}{{site.mapboxjsbase}}{% else %}https://api.tiles.mapbox.com/mapbox.js/{% if site.mapboxjs %}{{site.mapboxjs}}{% else %}v1.6.5{% endif %}{% endif %}/mapbox.js'></script>

<script>
window.mapbox_api = '{{site.api}}';
Expand All @@ -145,16 +153,16 @@
L.mapbox.config.HTTPS_URL = window.mapbox_tileApi + '/v4';
}
</script>
<script src='{% if site.baseApi %}{{site.baseApi}}{% else %}https://mapbox.com{% endif %}/base.js/dist/base.js'></script>
<script src='{% if site.baseApi %}{{site.baseApi}}{% else %}https://www.mapbox.com{% endif %}/base.js/dist/base.js'></script>
{% if site.test %}<script src='{{site.url}}/test/tape.js'></script>{% endif %}
{% if page.head %}{{page.head}}{% endif %}
</head>
<body class='{{page.class}} {{page.options}}'>
<body class='{{page.class}} {{page.options}}{% if page.blog_featured == true %} bleed{% endif %}'>
<div class='page-content'>
{% if page.app %}
{{content}}
{% else %}
<div class='masthead show-in-loaded col12 clearfix {% unless page.options contains 'bleed' %}fill-blue{% endunless %} {% unless page.options contains 'light' %}dark{% endunless %}'>
<div class='masthead show-in-loaded col12 clearfix {% unless page.options contains 'bleed' %}fill-blue{% endunless %} {% unless page.options contains 'light' %}dark{% endunless %}' data-swiftype-index='false'>
<div class='limiter clearfix'>
<nav class='col12 text-right pad2y contain animate clearfix noprint'>
<a class='fl mb-logo' href='/'></a>
Expand All @@ -167,7 +175,7 @@ <h4 class='logo-enterpriseaddon pin-topleft text-aqua block-in-enterprise'>Enter

<div class='{% unless page.options contains 'full' %} limiter clearfix{% endunless %}'>{{content}}</div>

<div class='footer footer-in-docs clearfix contain hide-mobile fill-light'>
<div class='footer footer-in-docs clearfix contain hide-mobile fill-light' data-swiftype-index='false'>

<div class='limiter clearfix'>
<div class='footer-in-docs footer-cols-in-docs clearfix col12 pad8y small'>
Expand Down Expand Up @@ -227,15 +235,15 @@ <h3 class='space-bottom1'>Sign up for our newsletter</h3>
<fieldset class='clearfix newsletter-in-docs input-pill col12 pill with-icon'>
<span class='icon mail quiet'></span>
<input type='text' value='' placeholder='Email address' name='email' class='col9 required email'>
<input type='submit' value='Subscribe' class='col3'>
<input type='submit' value='Subscribe' class='button col3'>
</fieldset>
</form>
</div>
</div>

</div>

<div class='footer-in-docs terms-in-docs col12 center footer-copyright small pad4 noprint fill-light contain'>
<div class='footer-in-docs terms-in-docs col12 center footer-copyright small pad4 noprint fill-light contain' data-swiftype-index='false'>
<a href='{{site.url}}/tos'>Terms</a> +
<a href='{{site.url}}/privacy'>Privacy</a>
&copy; Mapbox
Expand Down
67 changes: 67 additions & 0 deletions docs/_posts/examples/3400-01-03-flyto-options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
layout: example
category: example
title: Slowly fly to location
description: Using .flyTo with flyOptions
---

<style>
#fly {
display: block;
position: relative;
margin: 0px auto;
width: 50%;
height: 40px;
padding: 10px;
border: none;
border-radius: 3px;
font-size: 12px;
text-align: center;
color: #fff;
background: #ee8a65;
}
</style>
<div id='map'></div>
<br />
<button onclick='fly();' id='fly'>Fly</button>
<script>
var start = [40, -74.50];
var end = [40, 74.50];
var map = new mapboxgl.Map({
container: 'map',
style: 'https://www.mapbox.com/mapbox-gl-styles/styles/outdoors-v7.json',
center: start,
zoom: 9
});

var isAtStart = true;

function fly() {
// depending on whether we're currently at point a or b, aim for
// point a or b
var target = isAtStart ? end : start;

// and now we're at the opposite point
isAtStart = !isAtStart;

map.flyTo({
// These options control the ending camera position: centered at
// the target, at zoom level 9, and north up.
center: target,
zoom: 9,
bearing: 0,

// These options control the flight curve, making it move
// slowly and zoom out almost completely before starting
// to pan.
speed: 0.2, // make the flying slow
curve: 1, // change the speed at which it zooms out

// This can be any easing function: it takes a number between
// 0 and 1 and returns another number between 0 and 1.
easing: function (t) {
return t;
}
});
}
</script>
4 changes: 2 additions & 2 deletions docs/_posts/examples/3400-01-03-flyto.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
function fly() {
// Fly to a random location by offsetting the point 40, -74.50
// by up to 5 degrees.
map.flyTo([
map.flyTo({ center: [
40 + (Math.random() - 0.5) * 10,
-74.50 + (Math.random() - 0.5) * 10]);
-74.50 + (Math.random() - 0.5) * 10] });
}
</script>
37 changes: 0 additions & 37 deletions docs/_posts/examples/3400-01-03-mouse-latlng.html

This file was deleted.

Loading