Merge branch 'master' into performance

This commit is contained in:
Bryan Housel
2017-08-24 12:06:36 -04:00
29 changed files with 964 additions and 72 deletions

View File

@@ -4,5 +4,7 @@ node_js:
- "6"
- "8"
sudo: required
before_script:
- npm run all
after_success:
- ./scripts/txpush.sh

View File

@@ -48,8 +48,26 @@ This is only necessary the first time so that the build process can create symbo
To run the current development version of iD on your own computer:
1. Create a local `git clone` of the project, then `cd` into the project folder
2. Run `npm install` (this will run the `prepublish` script that builds everything)
#### Cloning the repository
The repository is reasonably large. and it's unlikely that you need the full history. If you are happy to wait for it all to download, run:
```
git clone https://github.com/openstreetmap/iD.git
```
To clone only the most recent version, instead use a 'shallow clone':
```
git clone --depth=1 https://github.com/openstreetmap/iD.git
```
If you want to add in the full history later on, perhaps to run `git blame` or `git log`, run `git fetch --depth=1000000`
#### Building iD
1. `cd` into the newly cloned project folder
2. Run `npm install`
3. Run `npm run all`
3. Run `npm start`
4. Open `http://localhost:8080/` in a web browser

View File

@@ -53,7 +53,7 @@
{
"countryCodes": ["vn"],
"format": [
["housenumber", "street","unit"],
["housenumber", "street"],
["subdistrict"],
["district"],
["city"],
@@ -122,8 +122,7 @@
"countryCodes": ["cn"],
"format": [
["postcode", "province"],
["city", "unit"],
["district"],
["city", "district"],
["street", "housenumber"]
]
}

View File

@@ -1707,7 +1707,7 @@ en:
amenity/doctors:
# amenity=doctors
name: Doctor
# 'terms: medic*'
# 'terms: medic*,physician'
terms: '<translate with synonyms or related terms for ''Doctor'', separated by commas>'
amenity/dojo:
# amenity=dojo
@@ -1958,6 +1958,11 @@ en:
name: Shelter
# 'terms: lean-to,gazebo,picnic'
terms: '<translate with synonyms or related terms for ''Shelter'', separated by commas>'
amenity/shower:
# amenity=shower
name: Shower
# 'terms: rain closet'
terms: '<translate with synonyms or related terms for ''Shower'', separated by commas>'
amenity/social_facility:
# amenity=social_facility
name: Social Facility
@@ -2112,6 +2117,71 @@ en:
# 'area:highway=*'
name: Road Surface
terms: '<translate with synonyms or related terms for ''Road Surface'', separated by commas>'
attraction/amusement_ride:
# attraction=amusement_ride
name: Amusement Ride
# 'terms: theme park,carnival ride'
terms: '<translate with synonyms or related terms for ''Amusement Ride'', separated by commas>'
attraction/animal:
# attraction=animal
name: Animal
# 'terms: zoo,theme park,animal park,lion,tiger,bear'
terms: '<translate with synonyms or related terms for ''Animal'', separated by commas>'
attraction/big_wheel:
# attraction=big_wheel
name: Big Wheel
# 'terms: ferris wheel,theme park,amusement ride'
terms: '<translate with synonyms or related terms for ''Big Wheel'', separated by commas>'
attraction/bumper_car:
# attraction=bumper_car
name: Bumper Car
# 'terms: theme park,dodgem cars,autoscooter'
terms: '<translate with synonyms or related terms for ''Bumper Car'', separated by commas>'
attraction/bungee_jumping:
# attraction=bungee_jumping
name: Bungee Jumping
# 'terms: theme park,bungy jumping,jumping platform'
terms: '<translate with synonyms or related terms for ''Bungee Jumping'', separated by commas>'
attraction/carousel:
# attraction=carousel
name: Carousel
# 'terms: theme park,roundabout,merry-go-round,galloper,jumper,horseabout,flying horses'
terms: '<translate with synonyms or related terms for ''Carousel'', separated by commas>'
attraction/dark_ride:
# attraction=dark_ride
name: Dark Ride
# 'terms: theme park,ghost train'
terms: '<translate with synonyms or related terms for ''Dark Ride'', separated by commas>'
attraction/drop_tower:
# attraction=drop_tower
name: Drop Tower
# 'terms: theme park,amusement ride,gondola,tower,big drop'
terms: '<translate with synonyms or related terms for ''Drop Tower'', separated by commas>'
attraction/pirate_ship:
# attraction=pirate_ship
name: Pirate Ship
# 'terms: theme park,carnival ride,amusement ride'
terms: '<translate with synonyms or related terms for ''Pirate Ship'', separated by commas>'
attraction/river_rafting:
# attraction=river_rafting
name: River Rafting
# 'terms: theme park,aquatic park,water park,rafting simulator,river rafting ride,river rapids ride'
terms: '<translate with synonyms or related terms for ''River Rafting'', separated by commas>'
attraction/roller_coaster:
# attraction=roller_coaster
name: Roller Coaster
# 'terms: theme park,amusement ride'
terms: '<translate with synonyms or related terms for ''Roller Coaster'', separated by commas>'
attraction/train:
# attraction=train
name: Tourist Train
# 'terms: theme park,rackless train,road train,Tschu-Tschu train,dotto train,park train'
terms: '<translate with synonyms or related terms for ''Tourist Train'', separated by commas>'
attraction/water_slide:
# attraction=water_slide
name: Water Slide
# 'terms: theme park,aquatic park,water park,flumes,water chutes,hydroslides'
terms: '<translate with synonyms or related terms for ''Water Slide'', separated by commas>'
barrier:
# barrier=*
name: Barrier
@@ -2580,6 +2650,11 @@ en:
name: Fire Hydrant
# 'terms: fire plug'
terms: '<translate with synonyms or related terms for ''Fire Hydrant'', separated by commas>'
emergency/life_ring:
# emergency=life_ring
name: Life Ring
# 'terms: life buoy,kisby ring,kisbie ring,perry buoy'
terms: '<translate with synonyms or related terms for ''Life Ring'', separated by commas>'
emergency/no:
# emergency=no
name: Emergency Access No
@@ -3658,7 +3733,6 @@ en:
office/physician:
# office=physician
name: Physician
terms: '<translate with synonyms or related terms for ''Physician'', separated by commas>'
office/political_party:
# office=political_party
name: Political Party

View File

@@ -1316,7 +1316,8 @@
"area"
],
"terms": [
"medic*"
"medic*",
"physician"
],
"tags": {
"amenity": "doctors"
@@ -2565,6 +2566,28 @@
},
"name": "Shelter"
},
"amenity/shower": {
"icon": "water",
"fields": [
"operator",
"opening_hours",
"fee",
"supervised",
"building_area"
],
"geometry": [
"point",
"vertex",
"area"
],
"terms": [
"rain closet"
],
"tags": {
"amenity": "shower"
},
"name": "Shower"
},
"amenity/social_facility": {
"icon": "poi-social-facility",
"fields": [
@@ -3317,6 +3340,296 @@
},
"name": "Road Surface"
},
"attraction/amusement_ride": {
"icon": "amusement-park",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"carnival ride"
],
"tags": {
"attraction": "amusement_ride"
},
"name": "Amusement Ride"
},
"attraction/animal": {
"icon": "zoo",
"fields": [
"name",
"operator"
],
"geometry": [
"point",
"area"
],
"terms": [
"zoo",
"theme park",
"animal park",
"lion",
"tiger",
"bear"
],
"tags": {
"attraction": "animal"
},
"name": "Animal"
},
"attraction/big_wheel": {
"icon": "amusement-park",
"fields": [
"name",
"operator",
"height",
"opening_hours"
],
"geometry": [
"point"
],
"terms": [
"ferris wheel",
"theme park",
"amusement ride"
],
"tags": {
"attraction": "big_wheel"
},
"name": "Big Wheel"
},
"attraction/bumper_car": {
"icon": "car",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"dodgem cars",
"autoscooter"
],
"tags": {
"attraction": "bumper_car"
},
"name": "Bumper Car"
},
"attraction/bungee_jumping": {
"icon": "pitch",
"fields": [
"name",
"operator",
"height",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"bungy jumping",
"jumping platform"
],
"tags": {
"attraction": "bungee_jumping"
},
"name": "Bungee Jumping"
},
"attraction/carousel": {
"icon": "horse-riding",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"roundabout",
"merry-go-round",
"galloper",
"jumper",
"horseabout",
"flying horses"
],
"tags": {
"attraction": "carousel"
},
"name": "Carousel"
},
"attraction/dark_ride": {
"icon": "rail-metro",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"line",
"area"
],
"terms": [
"theme park",
"ghost train"
],
"tags": {
"attraction": "dark_ride"
},
"name": "Dark Ride"
},
"attraction/drop_tower": {
"icon": "poi-tower",
"fields": [
"name",
"operator",
"height",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"amusement ride",
"gondola",
"tower",
"big drop"
],
"tags": {
"attraction": "drop_tower"
},
"name": "Drop Tower"
},
"attraction/pirate_ship": {
"icon": "amusement-park",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point"
],
"terms": [
"theme park",
"carnival ride",
"amusement ride"
],
"tags": {
"attraction": "pirate_ship"
},
"name": "Pirate Ship"
},
"attraction/river_rafting": {
"icon": "ferry",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"line"
],
"terms": [
"theme park",
"aquatic park",
"water park",
"rafting simulator",
"river rafting ride",
"river rapids ride"
],
"tags": {
"attraction": "river_rafting"
},
"name": "River Rafting"
},
"attraction/roller_coaster": {
"icon": "amusement-park",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"amusement ride"
],
"tags": {
"attraction": "roller_coaster"
},
"name": "Roller Coaster"
},
"attraction/train": {
"icon": "rail",
"fields": [
"name",
"operator",
"fee",
"opening_hours"
],
"geometry": [
"point",
"line"
],
"terms": [
"theme park",
"rackless train",
"road train",
"Tschu-Tschu train",
"dotto train",
"park train"
],
"tags": {
"attraction": "train"
},
"name": "Tourist Train"
},
"attraction/water_slide": {
"icon": "swimming",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"line",
"area"
],
"terms": [
"theme park",
"aquatic park",
"water park",
"flumes",
"water chutes",
"hydroslides"
],
"tags": {
"attraction": "water_slide"
},
"name": "Water Slide"
},
"barrier": {
"icon": "roadblock",
"geometry": [
@@ -5380,6 +5693,27 @@
},
"name": "Fire Hydrant"
},
"emergency/life_ring": {
"icon": "circle-stroked",
"fields": [
"ref",
"operator"
],
"geometry": [
"point",
"vertex"
],
"terms": [
"life buoy",
"kisby ring",
"kisbie ring",
"perry buoy"
],
"tags": {
"emergency": "life_ring"
},
"name": "Life Ring"
},
"emergency/phone": {
"icon": "emergency-phone",
"fields": [
@@ -5896,7 +6230,6 @@
"fields": [
"name",
"oneway",
"maxspeed",
"lanes",
"surface",
"structure",
@@ -6588,7 +6921,8 @@
},
"highway/traffic_mirror": {
"geometry": [
"point"
"point",
"vertex"
],
"tags": {
"highway": "traffic_mirror"
@@ -9761,6 +10095,25 @@
"terms": [],
"name": "Office"
},
"office/physician": {
"icon": "commercial",
"fields": [
"name",
"address",
"building_area",
"opening_hours"
],
"geometry": [
"point",
"vertex",
"area"
],
"tags": {
"office": "physician"
},
"searchable": false,
"name": "Physician"
},
"office/travel_agent": {
"icon": "suitcase",
"fields": [
@@ -10143,25 +10496,6 @@
"terms": [],
"name": "NGO Office"
},
"office/physician": {
"icon": "commercial",
"fields": [
"name",
"address",
"building_area",
"opening_hours"
],
"geometry": [
"point",
"vertex",
"area"
],
"tags": {
"office": "physician"
},
"terms": [],
"name": "Physician"
},
"office/political_party": {
"icon": "commercial",
"fields": [

View File

@@ -11,7 +11,8 @@
"area"
],
"terms": [
"medic*"
"medic*",
"physician"
],
"tags": {
"amenity": "doctors"

View File

@@ -0,0 +1,22 @@
{
"icon": "water",
"fields": [
"operator",
"opening_hours",
"fee",
"supervised",
"building_area"
],
"geometry": [
"point",
"vertex",
"area"
],
"terms": [
"rain closet"
],
"tags": {
"amenity": "shower"
},
"name": "Shower"
}

View File

@@ -0,0 +1,20 @@
{
"icon": "amusement-park",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"carnival ride"
],
"tags": {
"attraction": "amusement_ride"
},
"name": "Amusement Ride"
}

View File

@@ -0,0 +1,23 @@
{
"icon": "zoo",
"fields": [
"name",
"operator"
],
"geometry": [
"point",
"area"
],
"terms": [
"zoo",
"theme park",
"animal park",
"lion",
"tiger",
"bear"
],
"tags": {
"attraction": "animal"
},
"name": "Animal"
}

View File

@@ -0,0 +1,21 @@
{
"icon": "amusement-park",
"fields": [
"name",
"operator",
"height",
"opening_hours"
],
"geometry": [
"point"
],
"terms": [
"ferris wheel",
"theme park",
"amusement ride"
],
"tags": {
"attraction": "big_wheel"
},
"name": "Big Wheel"
}

View File

@@ -0,0 +1,21 @@
{
"icon": "car",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"dodgem cars",
"autoscooter"
],
"tags": {
"attraction": "bumper_car"
},
"name": "Bumper Car"
}

View File

@@ -0,0 +1,22 @@
{
"icon": "pitch",
"fields": [
"name",
"operator",
"height",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"bungy jumping",
"jumping platform"
],
"tags": {
"attraction": "bungee_jumping"
},
"name": "Bungee Jumping"
}

View File

@@ -0,0 +1,25 @@
{
"icon": "horse-riding",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"roundabout",
"merry-go-round",
"galloper",
"jumper",
"horseabout",
"flying horses"
],
"tags": {
"attraction": "carousel"
},
"name": "Carousel"
}

View File

@@ -0,0 +1,21 @@
{
"icon": "rail-metro",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"line",
"area"
],
"terms": [
"theme park",
"ghost train"
],
"tags": {
"attraction": "dark_ride"
},
"name": "Dark Ride"
}

View File

@@ -0,0 +1,24 @@
{
"icon": "poi-tower",
"fields": [
"name",
"operator",
"height",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"amusement ride",
"gondola",
"tower",
"big drop"
],
"tags": {
"attraction": "drop_tower"
},
"name": "Drop Tower"
}

View File

@@ -0,0 +1,20 @@
{
"icon": "amusement-park",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point"
],
"terms": [
"theme park",
"carnival ride",
"amusement ride"
],
"tags": {
"attraction": "pirate_ship"
},
"name": "Pirate Ship"
}

View File

@@ -0,0 +1,24 @@
{
"icon": "ferry",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"line"
],
"terms": [
"theme park",
"aquatic park",
"water park",
"rafting simulator",
"river rafting ride",
"river rapids ride"
],
"tags": {
"attraction": "river_rafting"
},
"name": "River Rafting"
}

View File

@@ -0,0 +1,20 @@
{
"icon": "amusement-park",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"point",
"area"
],
"terms": [
"theme park",
"amusement ride"
],
"tags": {
"attraction": "roller_coaster"
},
"name": "Roller Coaster"
}

View File

@@ -0,0 +1,25 @@
{
"icon": "rail",
"fields": [
"name",
"operator",
"fee",
"opening_hours"
],
"geometry": [
"point",
"line"
],
"terms": [
"theme park",
"rackless train",
"road train",
"Tschu-Tschu train",
"dotto train",
"park train"
],
"tags": {
"attraction": "train"
},
"name": "Tourist Train"
}

View File

@@ -0,0 +1,24 @@
{
"icon": "swimming",
"fields": [
"name",
"operator",
"opening_hours"
],
"geometry": [
"line",
"area"
],
"terms": [
"theme park",
"aquatic park",
"water park",
"flumes",
"water chutes",
"hydroslides"
],
"tags": {
"attraction": "water_slide"
},
"name": "Water Slide"
}

View File

@@ -0,0 +1,21 @@
{
"icon": "circle-stroked",
"fields": [
"ref",
"operator"
],
"geometry": [
"point",
"vertex"
],
"terms": [
"life buoy",
"kisby ring",
"kisbie ring",
"perry buoy"
],
"tags": {
"emergency": "life_ring"
},
"name": "Life Ring"
}

View File

@@ -3,7 +3,6 @@
"fields": [
"name",
"oneway",
"maxspeed",
"lanes",
"surface",
"structure",

View File

@@ -1,6 +1,7 @@
{
"geometry": [
"point"
"point",
"vertex"
],
"tags": {
"highway": "traffic_mirror"

View File

@@ -14,6 +14,6 @@
"tags": {
"office": "physician"
},
"terms": [],
"searchable": false,
"name": "Physician"
}

View File

@@ -479,6 +479,10 @@
"key": "amenity",
"value": "shelter"
},
{
"key": "amenity",
"value": "shower"
},
{
"key": "amenity",
"value": "social_facility"
@@ -606,6 +610,58 @@
{
"key": "area:highway"
},
{
"key": "attraction",
"value": "amusement_ride"
},
{
"key": "attraction",
"value": "animal"
},
{
"key": "attraction",
"value": "big_wheel"
},
{
"key": "attraction",
"value": "bumper_car"
},
{
"key": "attraction",
"value": "bungee_jumping"
},
{
"key": "attraction",
"value": "carousel"
},
{
"key": "attraction",
"value": "dark_ride"
},
{
"key": "attraction",
"value": "drop_tower"
},
{
"key": "attraction",
"value": "pirate_ship"
},
{
"key": "attraction",
"value": "river_rafting"
},
{
"key": "attraction",
"value": "roller_coaster"
},
{
"key": "attraction",
"value": "train"
},
{
"key": "attraction",
"value": "water_slide"
},
{
"key": "barrier"
},
@@ -1066,6 +1122,10 @@
"key": "emergency",
"value": "fire_hydrant"
},
{
"key": "emergency",
"value": "life_ring"
},
{
"key": "emergency",
"value": "phone"
@@ -1930,6 +1990,10 @@
{
"key": "office"
},
{
"key": "office",
"value": "physician"
},
{
"key": "office",
"value": "travel_agent"
@@ -2002,10 +2066,6 @@
"key": "office",
"value": "ngo"
},
{
"key": "office",
"value": "physician"
},
{
"key": "office",
"value": "political_party"

70
dist/locales/en.json vendored
View File

@@ -2559,7 +2559,7 @@
},
"amenity/doctors": {
"name": "Doctor",
"terms": "medic*"
"terms": "medic*,physician"
},
"amenity/dojo": {
"name": "Dojo / Martial Arts Academy",
@@ -2765,6 +2765,10 @@
"name": "Shelter",
"terms": "lean-to,gazebo,picnic"
},
"amenity/shower": {
"name": "Shower",
"terms": "rain closet"
},
"amenity/social_facility": {
"name": "Social Facility",
"terms": ""
@@ -2893,6 +2897,58 @@
"name": "Road Surface",
"terms": ""
},
"attraction/amusement_ride": {
"name": "Amusement Ride",
"terms": "theme park,carnival ride"
},
"attraction/animal": {
"name": "Animal",
"terms": "zoo,theme park,animal park,lion,tiger,bear"
},
"attraction/big_wheel": {
"name": "Big Wheel",
"terms": "ferris wheel,theme park,amusement ride"
},
"attraction/bumper_car": {
"name": "Bumper Car",
"terms": "theme park,dodgem cars,autoscooter"
},
"attraction/bungee_jumping": {
"name": "Bungee Jumping",
"terms": "theme park,bungy jumping,jumping platform"
},
"attraction/carousel": {
"name": "Carousel",
"terms": "theme park,roundabout,merry-go-round,galloper,jumper,horseabout,flying horses"
},
"attraction/dark_ride": {
"name": "Dark Ride",
"terms": "theme park,ghost train"
},
"attraction/drop_tower": {
"name": "Drop Tower",
"terms": "theme park,amusement ride,gondola,tower,big drop"
},
"attraction/pirate_ship": {
"name": "Pirate Ship",
"terms": "theme park,carnival ride,amusement ride"
},
"attraction/river_rafting": {
"name": "River Rafting",
"terms": "theme park,aquatic park,water park,rafting simulator,river rafting ride,river rapids ride"
},
"attraction/roller_coaster": {
"name": "Roller Coaster",
"terms": "theme park,amusement ride"
},
"attraction/train": {
"name": "Tourist Train",
"terms": "theme park,rackless train,road train,Tschu-Tschu train,dotto train,park train"
},
"attraction/water_slide": {
"name": "Water Slide",
"terms": "theme park,aquatic park,water park,flumes,water chutes,hydroslides"
},
"barrier": {
"name": "Barrier",
"terms": ""
@@ -3357,6 +3413,10 @@
"name": "Fire Hydrant",
"terms": "fire plug"
},
"emergency/life_ring": {
"name": "Life Ring",
"terms": "life buoy,kisby ring,kisbie ring,perry buoy"
},
"emergency/phone": {
"name": "Emergency Phone",
"terms": ""
@@ -4233,6 +4293,10 @@
"name": "Office",
"terms": ""
},
"office/physician": {
"name": "Physician",
"terms": ""
},
"office/travel_agent": {
"name": "Travel Agency",
"terms": ""
@@ -4305,10 +4369,6 @@
"name": "NGO Office",
"terms": ""
},
"office/physician": {
"name": "Physician",
"terms": ""
},
"office/political_party": {
"name": "Political Party",
"terms": ""

View File

@@ -7,7 +7,7 @@ import { utilPrefixCSSProperty } from '../util';
export function rendererTileLayer(context) {
var tileSize = 256,
tile = d3geoTile(),
geotile = d3geoTile(),
projection,
cache = {},
tileOrigin,
@@ -40,7 +40,8 @@ export function rendererTileLayer(context) {
return [
Math.floor(t[0] * power),
Math.floor(t[1] * power),
t[2] + distance];
t[2] + distance
];
}
@@ -74,14 +75,31 @@ export function rendererTileLayer(context) {
// Update tiles based on current state of `projection`.
function background(selection) {
tile.scale(projection.scale() * 2 * Math.PI)
.translate(projection.translate());
z = Math.max(Math.log(projection.scale() * 2 * Math.PI) / Math.log(2) - 8, 0);
var pixelOffset;
if (source) {
pixelOffset = [
source.offset()[0] * Math.pow(2, z),
source.offset()[1] * Math.pow(2, z)
];
} else {
pixelOffset = [0, 0];
}
var translate = [
projection.translate()[0] + pixelOffset[0],
projection.translate()[1] + pixelOffset[1]
];
geotile
.scale(projection.scale() * 2 * Math.PI)
.translate(translate);
tileOrigin = [
projection.scale() * Math.PI - projection.translate()[0],
projection.scale() * Math.PI - projection.translate()[1]];
z = Math.max(Math.log(projection.scale() * 2 * Math.PI) / Math.log(2) - 8, 0);
projection.scale() * Math.PI - translate[0],
projection.scale() * Math.PI - translate[1]
];
render(selection);
}
@@ -96,7 +114,7 @@ export function rendererTileLayer(context) {
var showDebug = context.getDebug('tile') && !source.overlay;
if (source.validZoom(z)) {
tile().forEach(function(d) {
geotile().forEach(function(d) {
addSource(d);
if (d[3] === '') return;
if (typeof d[3] !== 'string') return; // Workaround for #2295
@@ -115,11 +133,6 @@ export function rendererTileLayer(context) {
});
}
var pixelOffset = [
source.offset()[0] * Math.pow(2, z),
source.offset()[1] * Math.pow(2, z)
];
function load(d) {
cache[d[3]] = true;
@@ -143,16 +156,16 @@ export function rendererTileLayer(context) {
var _ts = tileSize * Math.pow(2, z - d[2]);
var scale = tileSizeAtZoom(d, z);
return 'translate(' +
((d[0] * _ts) - tileOrigin[0] + pixelOffset[0]) + 'px,' +
((d[1] * _ts) - tileOrigin[1] + pixelOffset[1]) + 'px)' +
((d[0] * _ts) - tileOrigin[0]) + 'px,' +
((d[1] * _ts) - tileOrigin[1]) + 'px) ' +
'scale(' + scale + ',' + scale + ')';
}
function tileCenter(d) {
var _ts = tileSize * Math.pow(2, z - d[2]);
return [
((d[0] * _ts) - tileOrigin[0] + pixelOffset[0] + (_ts / 2)),
((d[1] * _ts) - tileOrigin[1] + pixelOffset[1] + (_ts / 2))
((d[0] * _ts) - tileOrigin[0] + (_ts / 2)),
((d[1] * _ts) - tileOrigin[1] + (_ts / 2))
];
}
@@ -164,7 +177,7 @@ export function rendererTileLayer(context) {
// Pick a representative tile near the center of the viewport
// (This is useful for sampling the imagery vintage)
var dims = tile.size(),
var dims = geotile.size(),
mapCenter = [dims[0] / 2, dims[1] / 2],
minDist = Math.max(dims[0], dims[1]),
nearCenter;
@@ -261,8 +274,8 @@ export function rendererTileLayer(context) {
background.dimensions = function(_) {
if (!arguments.length) return tile.size();
tile.size(_);
if (!arguments.length) return geotile.size();
geotile.size(_);
return background;
};
@@ -271,7 +284,7 @@ export function rendererTileLayer(context) {
if (!arguments.length) return source;
source = _;
cache = {};
tile.scaleExtent(source.scaleExtent);
geotile.scaleExtent(source.scaleExtent);
return background;
};

View File

@@ -16,9 +16,8 @@ export function uiSourceSwitch(context) {
var live = d3.select(this)
.classed('live');
context.connection()
.switch(live ? keys[1] : keys[0]);
context.history().clearSaved();
context.connection().switch(live ? keys[1] : keys[0]);
context.enter(modeBrowse(context));
context.flush();

View File

@@ -21,7 +21,6 @@
"dist:svg:id": "node svg/spriteify.js --svg svg/iD-sprite.src.svg --json svg/iD-sprite.json > dist/img/iD-sprite.svg",
"imagery": "node data/update_imagery",
"lint": "eslint *.js js/id test/spec modules",
"prepublish": "npm run all",
"start": "node development_server.js develop",
"test": "npm-run-all -s lint build test:**",
"test:phantom": "phantomjs --web-security=no node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/index.html spec",
@@ -33,7 +32,7 @@
"marked": "0.3.6",
"osm-auth": "1.0.2",
"rbush": "2.0.1",
"@mapbox/sexagesimal": "1.0.0",
"@mapbox/sexagesimal": "1.1.0",
"@mapbox/togeojson": "0.16.0",
"wmf-sitematrix": "0.1.4"
},
@@ -60,13 +59,13 @@
"phantomjs-prebuilt": "~2.1.11",
"request": "^2.81.0",
"rollup": "0.45.2",
"rollup-plugin-commonjs": "8.1.0",
"rollup-plugin-commonjs": "8.1.1",
"rollup-plugin-json": "2.2.0",
"rollup-plugin-node-resolve": "3.0.0",
"shelljs": "^0.7.5",
"shx": "^0.2.1",
"sinon": "^2.3.0",
"sinon-chai": "^2.12.0",
"sinon": "^3.2.1",
"sinon-chai": "^2.13.0",
"smash": "0.0",
"svg-sprite": "1.3.7",
"uglify-js": "^3.0.0",