~dr|z3d
@RN_
@StormyCloud
@T3s|4
@eyedeekay
@orignal
@postman
@zzz
%Liorar
+FreefallHeavens
+Xeha
+acetone
+bak83
+cancername
+cumlord
+hk
+profetikla
+uop23ip
+weko
An0nm0n
Arch
Danny
DeltaOreo
Irc2PGuest21357
Irc2PGuest21881
Irc2PGuest43426
Leopold
Meow
Nausicaa
Onn4l7h
Onn4|7h
Over1
RN
T3s|4_
anon2
anu3
boonst
mareki2pb
not_bob_afk
plap
poriori_
shiver_
simprelay
solidx66
thetia
tr
u5657
dr|z3d
one sec, zzz, I'll have a cleaned up svg map for you to play with.
cumlord
For sure, but flattening the water would look nice I think
dr|z3d
here you go zzz, cake.i2p/file/07GaNok3k5_q1STaLJBgx4MhbRNVHTq02fTmkyF9u_OhScKlCtOx/worldmap.zip
dr|z3d
that's basically the cartosvg worldmap with some minor optimizations to presentation and easier to read source.
dr|z3d
not great, but it has the tagged countries and hover tooltips enabled.
dr|z3d
ok, no javascript, no html, not much inline styling, just the svg -> cake.i2p/file/SWstYbnenL_p37xsLCwZ8iaIsQ9blpiNYxRVQN1Nq_RLexEb1TaB/map3.svg
dr|z3d
retains the country id tags.
dr|z3d
how does 35KB for a png sound, zzz?
dr|z3d
that's how you do 2 color, cumlord ^
dr|z3d
latest revision of svg map -> cake.i2p/file/vzWGlV3oJS_APP6G1KFF4nnrmZW7Kw4lhBu6NCD4a_UIJ2zhPFYZ/map5-cc.svg
dr|z3d
this one swaps out the country name ids for 2 letter country codes.
dr|z3d
name ids were also dubious, you can't have spaces in id tags.
dr|z3d
with the country codes, possible to reference elements in the country table and display the (translated) country name on a tooltip.
dr|z3d
tz, republic of needs fixup in that svg. otherwise should be good.
dr|z3d
dunno if you missed scrollback, zzz, but if you did: cake.i2p/file/vzWGlV3oJS_APP6G1KFF4nnrmZW7Kw4lhBu6NCD4a_UIJ2zhPFYZ/map5-cc.svg (2 letter country codes, tk(?) republic of needs fixup) and png as per your dimensions/cropping/projection: cake.i2p/file/UHrBa1vYWT_71eNDpZDkE1OEf0ySRKuoMk2QaT5Ja_W9givrsoxj/g51866.png (35K)
zzz
yeah i got them. they all need fixing of something but will pick one and see how it looks
dr|z3d
the png you should be able to swap right in.
zzz
its the wrong size but the crop looks right
dr|z3d
wrong size? I took your dimensions. or thought I did.
zzz
1600x848, I need 1200x636
dr|z3d
maybe it's scaled up, looking at your gitlab image. but it should be correct dimensions.
dr|z3d
yup, if you scale that down, it'll be correct.
dr|z3d
better if you do that in java, not with the image itself, then you get the benefit of a higher resolution image. but up to you. 1600x848 == 1200x636 scaled.
zzz
I think we're on the right track here, it's much better with one-color ocean and no grid lines, what do you think?
dr|z3d
I think so, grid lines and topological data don't do us any favors.
zzz
you started with cartosvg for these?
dr|z3d
yeah
dr|z3d
for the bitmap I chopped up the svg and jigsawed it back together.
dr|z3d
for the svg, I used their mercator map example and got rid of the crap, converted country ids to two letter codes to make them easier to leverage.
zzz
yeah it's useless with country names
dr|z3d
yeah, that's what I figured.
zzz
there's three messed up countries, one between kp and rs, then tz, then the last one
dr|z3d
one sec.
zzz
don't need the fix now ))
dr|z3d
might as well fix it now, then it's done.
zzz
could you do one where the country borders are visible to see what that looks like?
dr|z3d
would need to refactor the svg to do that, they're doing something a "bit weird" with the country paths.
dr|z3d
should fix the incorrect paths and country code: cake.i2p/file/SwJcThgTXJ_xaOLrFCt29Wif9hrCf7faOz6pryYuP_9uipDBltGM/map5-cc.svg
zzz
cant just add something to #countries style section?
zzz
yeah I don't get any of the paths, it's much different than what either batik or jfreesvg does
dr|z3d
no, that's the bit weird part. if you stroke the country paths, you get a bunch of lines emanating from the top left of the image.
dr|z3d
I'll have to take another look at the original and see what they're doing.
zzz
then you may as well not have the countries section in there at all
dr|z3d
no, you want those for tooltipping etc.
zzz
maybe
dr|z3d
it may be related to the fact that some of the countries aren't contiguous land masses.
dr|z3d
or it could be something to do with the (lack of) embedded javascript in our svg that they have in theirs.
zzz
but we also may need centroid coordinates, possibly converted from my data; borders aren't sufficient to draw lines between countries
dr|z3d
centroid coords being the center point for any given country?
zzz
yeah, that's my mercator.txt
zzz
converted from google lat/long data
dr|z3d
probably not required, that's just a javscript calc that looks at the path and decides where the center is.
dr|z3d
but who knows, maybe helpful.
zzz
I don't think you want js doing center calculations
dr|z3d
ok
dr|z3d
anyways, here's the original map, country names still exist, I've just cleaned it up, made it scale properly..
dr|z3d
but it retains the javascript etc so you've got borders, tooltips.
dr|z3d
hmm, apparently the javascript isn't required for tooltips and borders.
zzz
lower case m is relative
zzz
h and v are relative
zzz
but I see a lot of m0 0z which seeems like a no-op
zzz
so it looks like legal but heavily optimized paths
zzz
you should throw it into inkscape and try to figure out why the country borders are messed up
dr|z3d
believe me, I've done that. I think those paths are connecting non-contiguous land masses for countries.
dr|z3d
and javascript is required for the tooltips.
dr|z3d
because the js is embedded in the svg, umatrix doesn't detect it.
zzz
I'm playing with it in inspector now
zzz
but not always. US and Canada are fine. Argentina is not
zzz
trying to do a fill on argentina doesn't work either
dr|z3d
yeah, it's a bit janky.
dr|z3d
#jd_mvpfapz path.ssc-0-4#Argentina {
dr|z3d
fill: #f00;
dr|z3d
}
zzz
it's fine in mercator.svg but it's all sorts of borked in map5-cc.svg
zzz
back up and figure out what went wrong
dr|z3d
oh, I know what's different. aside from the country codes, I stripped the classes from the paths.
dr|z3d
(and the javascript)
zzz
did you do any sort of global replace or sed on it because that may have broken something
dr|z3d
yeah, plenty of that.
dr|z3d
that's why I'm looking at the latest mercator.svg revision I posted up on cake.
zzz
with js disabled, mercator.svg is still fine
zzz
so somewhere along the way you jakked up map5-cc.svg, it's unusable
zzz
it's not because of discontiguous countries
dr|z3d
yeah, except for the tooltips.
zzz
and it's not js that's fixing up your lines from 0,0
dr|z3d
sure, bunch of stuff got borked.
dr|z3d
so just forget about that, I'll work on mercactor.svg so we don't lose any functionality or visuals.
dr|z3d
it served it's purpose, the main one being a template for the png.
zzz
yup
dr|z3d
do we want the separate colors for the different regions? I'm thinking no.
zzz
re: tooltips, I thought maybe you could just put title=foo in there, but svg is not html. you can do <title>united states</title> though, that works, just tried it
dr|z3d
yeah, title should work apparently if you nest it inside the path.
zzz
it does
dr|z3d
obviously that doesn't come with styling per se, but I think you can target svg>title{...} to style it.
zzz
maybe
dr|z3d
or maybe not. doesn't wfm.
zzz
that SO article also talks about js getBoundingClientRect() to find things, but again that's going to mess up for countries like US with alaska and hawaii way out there, that's why we need the hardcoded centroid coordinates from google
zzz
agreed, no region colors
dr|z3d
ok, see how you like this...
dr|z3d
how/if
dr|z3d
that's sort of where we were before with the cc map, minus the two letter ccs, with geo-borders.
zzz
yeah that's pretty nice
dr|z3d
*thumbs up*
dr|z3d
colors will get tweaked, cruft removed without breaking stuff.
zzz
we're just playing around, don't work too hard on it
dr|z3d
ok, just want to clean a few things up. will make it easier for you to work with.
dr|z3d
ok, colors tweaked, inline styles moved to stylesheet which is now correctly located in the <defs> section at the top, region classes removed.
dr|z3d
and main fapz id renamed to geomap.
T3s|4
dr|z3d: your latest map and the tooltips look nice
dr|z3d
thanks, T3s|4, coming along :)
dr|z3d
ok, rev4. absolutely zero need for the animations, they just make the map load look jank.
dr|z3d
we want instant load. which we now have.
zzz
fapz was a head scratcher, yes animations were jank
dr|z3d
ok, final revision for now. some basic formatting for the javascript to make it slightly easier to read, and removal of the animation javascript stuff.
dr|z3d
ok, definitely the last revision for now. javascript formatting was still opaque, should be better now, but of course the javascript's still been minified/obfuscated, can't do much about that: cake.i2p/file/sHxrfbaoit_POrJhq25HCq5NulgEf0wJRvRnbxxvO_pUrAztQk0w/mercator6.svg
dr|z3d
ok, absolutely the last revision for now. unformatted javascript sorted: cake.i2p/file/1gqdhQ93Mq_jHlT9z76HhntI1OsMuwY7Og4Sj1YPW_7IGsEJGqfC/mercator7.svg
zzz
how would a combined base+overlay svg be generated? would we render the whole thing thru SVGGraphics2D every time?
zzz
or would the "base" svg be static, and it contains an href for the "overlay" part to viewmap.jsp where we puke out the lines and circles and text directly as svg, skipping SVGGraphics2D completely?
zzz
or does an XHR fetch and "inject" the "overlay" part via JS?
zzz
or is the overlay part a full sub-svg-document that it gets via href and we do generate it with SVGGraphics2D?
zzz
you want a sample overlay-only svg to play with it?
zzz
all I have is png right now but I could switch it up