Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Commit 77cf0dc

Browse files
committed
Update map example
1 parent 60368e8 commit 77cf0dc

File tree

3 files changed

+66
-67
lines changed

3 files changed

+66
-67
lines changed

source/assets/map.json

+64-65
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,64 @@
1-
{
2-
"type": "map",
3-
"data": {
4-
"meta": {
5-
"language": "eng",
6-
"rotation": 0,
7-
"copyright": {
8-
"font": {
9-
"size": {
10-
"value": 1,
11-
"unit": "millimeter"
12-
},
13-
"name": "Helvetica",
14-
"color": {
15-
"R": 0,
16-
"G": 0,
17-
"B": 0
18-
}
19-
},
20-
"anchor": "topleft"
21-
},
22-
"szhack": false,
23-
"preview": true
24-
},
25-
"paper": {
26-
"size": {
27-
"width": {
28-
"value": 5,
29-
"unit": "centimeter"
30-
},
31-
"height": {
32-
"value": 5,
33-
"unit": "centimeter"
34-
}
35-
}
36-
},
37-
"scaleDefinition": {
38-
"downLeft": {
39-
"coordSys": "wgs",
40-
"lat": 51.421730,
41-
"lon": 5.439652
42-
},
43-
"upRight": {
44-
"coordSys": "wgs",
45-
"lat": 51.457426,
46-
"lon": 5.513880
47-
}
48-
},
49-
"icons": [
50-
{
51-
"id": 1,
52-
"name": "Text Box",
53-
"source": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"81.36\" height=\"62.76\" mol_popupanchor=\"10.76 0\" viewBox=\"-0.7937500000000002 0.6749999999999998 21.525 16.603125\" xml:space=\"preserve\" mol_embed=\"true\" mol_dragall=\"true\" mol_resizeenabled=\"false\" mol_initial_update=\"TitleText\" mol_svganchor=\"11.46875 14.984375\"><g id=\"scale\" transform=\"scale(1)\"><path id=\"PointerPath\" d=\"M 9.96875 10.984375 L 9.96875 12.984375 L 11.46875 14.984375\" style=\"fill:none; stroke-width: 0.3;\" stroke=\"#000000\" mol_edit_style=\"false\" mol_edit_anchor=\"0 2\" mol_rectposition=\"BodyRect bottom middle\"></path><rect id=\"TopRect\" width=\"17.9375\" height=\"5.15625\" x=\"1\" y=\"2.46875\" fill=\"#000000\" stroke-dasharray=\"null\" stroke-width=\"0.1\" stroke=\"#000000\" mol_autoresizeid=\"TitleText\" mol_autoresizemargin=\"1\" mol_stack=\"top BodyRect\"></rect><rect id=\"BodyRect\" width=\"17.9375\" height=\"3.359375\" x=\"1\" y=\"7.625\" fill=\"#ffffff\" stroke-dasharray=\"null\" stroke-width=\"0.1\" stroke=\"#000000\" mol_sameheight=\"BodyText 0.5\" mol_stack=\"bottom TopRect\"></rect><text id=\"TitleText\" x=\"2\" y=\"6\" font-family=\"Helvetica\" font-weight=\"bold\" font-style=\"normal\" font-size=\"2.82222\" fill=\"#FFFFFF\" style=\"font-kerning:none; white-space:pre;\" mol_edit_style=\"true\" mol_edit_text=\"true\" mol_font=\"Helvetica-Bold\">Title stretch</text><text id=\"BodyText\" x=\"1.5\" y=\"10.01875\" font-family=\"Helvetica\" font-weight=\"normal\" font-style=\"normal\" font-size=\"2.11667\" fill=\"#000000\" style=\"font-kerning:none; white-space:pre;\" text-anchor=\"start\" mol_edit_style=\"true\" mol_edit_text=\"true\" mol_wrap=\"true BodyRect 0.5\" mol_font=\"Helvetica\"><tspan x=\"1.5\" dy=\"0\" id=\"BodyText0\">Body wrap</tspan></text><circle id=\"Point\" cx=\"11.46875\" cy=\"14.984375\" r=\"0.5\" fill=\"#000000\" stroke=\"none\" mol_pathposition=\"PointerPath 0 2\"></circle></g></svg>",
54-
"coord": {
55-
"coordSys": "wgs",
56-
"lat": 51.438524,
57-
"lon": 5.478412
58-
}
59-
}
60-
],
61-
"output": [
62-
"png"
63-
]
64-
}
65-
}
1+
{
2+
"type": "map",
3+
"data": {
4+
"meta": {
5+
"language": "eng",
6+
"rotation": 0,
7+
"copyright": {
8+
"font": {
9+
"size": {
10+
"value": 1,
11+
"unit": "millimeter"
12+
},
13+
"name": "Helvetica",
14+
"color": {
15+
"R": 0,
16+
"G": 0,
17+
"B": 0
18+
}
19+
},
20+
"anchor": "bottomright"
21+
},
22+
"preview": true
23+
},
24+
"paper": {
25+
"size": {
26+
"width": {
27+
"value": 10,
28+
"unit": "centimeter"
29+
},
30+
"height": {
31+
"value": 10,
32+
"unit": "centimeter"
33+
}
34+
}
35+
},
36+
"scaleDefinition": {
37+
"downLeft": {
38+
"coordSys": "wgs",
39+
"lat": 51.421730,
40+
"lon": 5.439652
41+
},
42+
"upRight": {
43+
"coordSys": "wgs",
44+
"lat": 51.457426,
45+
"lon": 5.513880
46+
}
47+
},
48+
"icons": [
49+
{
50+
"id": 1,
51+
"name": "Text Box",
52+
"source": "<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" mol_popupanchor=\"3.9 0\" viewBox=\"-0.027792739868164107 1.4376637458801267 18.33351287841797 9.762003993988037\" mol_embed=\"true\" mol_dragall=\"true\" mol_svganchor=\"1.5 8.67327880859375\" mol_initial_update=\"TitleText\" id=\"herea953e8ba-1f1a-4926-b2b1-0383c27b30d2\" class=\"noselect\" width=\"18.33351287841797\" height=\"9.762003993988037\" style=\"\"><g id=\"scale\" transform=\"scale(1)\" style=\"pointer-events:auto;\"><g name=\"textbox\" fill=\"#FF5C5C\" mol_edit_style=\"true\"><path id=\"Pointer\" d=\"M1.5,7.13372 L1.5,8.67328 L3,7.13372\" mol_edit_anchor=\"0 1\" mol_rectposition=\"Rectangle bottom start\"\/><path id=\"PointerLine\" d=\"M1.5,8.67328 L1.5,9.67328\" mol_pathposition=\"Pointer 0 1\"\/><rect id=\"Rectangle\" width=\"15.277928352355957\" height=\"4.168179512023926\" x=\"1.5\" y=\"2.965456485748291\" mol_edit_style=\"true\" mol_autoresizeid=\"TitleText\" mol_autoresizemargin=\"0.5\"\/><\/g><text id=\"TitleText\" x=\"2\" y=\"6\" font-family=\"Arial\" mol_font=\"ArialMT\" font-weight=\"400\" font-style=\"normal\" font-size=\"2.82222\" fill=\"#FFFFFF\" style=\"font-kerning:none; white-space:pre;\" mol_edit_style=\"true\" mol_edit_text=\"true\"><tspan x=\"2\" dy=\"0\" id=\"TitleText0\">Mapcreator<\/tspan><\/text><\/g><\/svg>",
53+
"coord": {
54+
"coordSys": "wgs",
55+
"lat": 51.444302,
56+
"lon": 5.47415
57+
}
58+
}
59+
],
60+
"output": [
61+
"svg"
62+
]
63+
}
64+
}

source/images/map_preview.png

-133 KB
Loading

source/v1/index.html.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ import * as mapObject from './map.json'; // NodeJS
744744
745745
const revision = await job.revisions.new({
746746
languageCode: 'eng',
747-
mapstyleSetId: 60 // Here Mapstyle
747+
mapstyleSetId: 186 // Maps4News mapstyle
748748
}).save(mapObject);
749749
750750
// 3. Building
@@ -787,7 +787,7 @@ $mapObject = file_get_contents('./map.json'); // As a string
787787
$revisionResponse = $http->post("/v1/jobs/$job->id/revisions", [
788788
GuzzleHttp\RequestOptions::JSON => [
789789
'language_code' => 'eng',
790-
'mapstyle_set_id' => 60, // Here Mapstyle
790+
'mapstyle_set_id' => 186, // Maps4News mapstyle
791791
'object' => $mapObject,
792792
],
793793
]);

0 commit comments

Comments
 (0)