Commit Graph

458 Commits

Author SHA1 Message Date
fminuti
62f8261b10 Fix for #2809
Fix for "Vector layers loose styling in IE8 when removing and adding back to the map" #2809
2015-07-23 11:33:58 +02:00
Vladimir Agafonkin
bf8f0b45b1 Revert canvas removeLayer regression, close #3661
This reverts commit 80b8d5f4c9.
2015-07-23 12:29:55 +03:00
Vladimir Agafonkin
64333d2dc3 reduce the throttle for canvas layers
It felt laggy with 66. 32 is just about right — 30fps.
2015-07-22 19:41:01 +03:00
Vladimir Agafonkin
80b8d5f4c9 improve canvas removeLayer perf, close #3076 2015-07-22 19:37:24 +03:00
Vladimir Agafonkin
0f105c8e9c Merge pull request #3547 from philippelatulippe/canvas-optimization
Simple canvas optimizations
2015-07-15 16:01:11 +03:00
Will Franklin
fd8759d5e1 Use ID lookup instead to avoid re-adding layer on style change 2015-07-14 17:45:57 +02:00
Yohan Boniface
76cb60705f Switch from L_PREFER_CANVAS to map.options.preferCanvas 2015-07-14 10:27:50 +02:00
Philippe Latulippe
fd64c7e5c3 Simple canvas optimizations:
- throttle mouseover
- don't check for hover when the map is being panned (since the mouse isn't moving in relation to the map)
- only check visible layers when checking for hover (by storing unculled layers in an array)
2015-07-13 22:22:31 +02:00
Yohan Boniface
1eab6079e8 Resuscitate L_PREFER_CANVAS 2015-07-13 19:05:06 +02:00
Vladimir Agafonkin
1ee24802a7 Merge pull request #3618 from wpf500/wpf-canvas-mouse-out
Check canvas mouseout
2015-07-13 15:33:34 +03:00
Will Franklin
76cd73c97a Check canvas mouseout 2015-07-13 12:42:39 +01:00
Yohan Boniface
50d7121f72 Make _fireDOMEvent accept optional targets
In the case of canvas path, we can't add the canvas element itself
as an interactiveTarget, given that it's big like the path bbox, and
thus would make all this bbox target of events (so also clicking
outside of the path itself, the layer would fire click event, for
example)
2015-07-06 13:55:59 +02:00
Will Franklin
320c46c6d5 Only mouse over one feature at a time 2015-07-02 16:15:43 +01:00
Vladimir Agafonkin
ae90893e1e Merge pull request #3582 from wpf500/wpf-mouse-event-order
Fix ordering of mouse events in Canvas renderer
2015-07-01 14:32:37 +03:00
Will Franklin
2bc78b26ca Fix ordering of mouse events in Canvas renderer 2015-07-01 12:31:00 +01:00
Vladimir Agafonkin
cca6e6165f Merge pull request #3580 from wpf500/wpf-bounds-check
Check bounds before clipping
2015-07-01 13:39:38 +03:00
Will Franklin
4952b37256 Check bounds before clipping 2015-07-01 11:24:05 +01:00
Alex Fedosov
93f4ba7f8e fix non-interactive vml layers 2015-06-19 12:32:17 +06:00
Vladimir Agafonkin
30b9b9cfd6 fix whitespace 2015-06-05 20:51:25 +03:00
Vladimir Agafonkin
a5bd03d0e4 add back viewreset
now it has different semantics though — it’s fired when a view is fully
reset, so that all layer DOM elements should be repositioned.
2015-06-05 20:51:21 +03:00
Vladimir Agafonkin
fd708bf173 don't project vectors on every zoom event 2015-06-05 20:51:20 +03:00
Vladimir Agafonkin
625161f15d make vectors work with flyTo 2015-06-05 20:51:20 +03:00
Vladimir Agafonkin
1e9c8649b3 simplify zoom transform math
changes the transform origin for all layers from 50% 50% (implied
default) to 0 0, making it MUCH easier to understand zoom transform
math.
2015-06-05 20:51:20 +03:00
Vladimir Agafonkin
2cf8cc008a simplify renderer animation math 2015-06-05 20:51:20 +03:00
Vladimir Agafonkin
d9e20a250d ditch zoomanim event scale/origin/offset props 2015-06-05 20:51:20 +03:00
Vladimir Agafonkin
d13aaac837 refactor _resetView; rely on zoom event in layers 2015-06-04 20:42:30 +03:00
Vladimir Agafonkin
fdd60cc66b ditch viewreset event, reliable zoomend
removes viewreset use everywhere; also changes event order to have
zoomend before move and moveend to make zoomend a reliable viewreset
successor
2015-06-04 20:42:28 +03:00
Vladimir Agafonkin
8ffbb707c6 add layer getElement methods 2015-05-21 19:57:12 +03:00
Iván Sánchez Ortega
555c80f20e Wrap all SVG paths inside a <g> 2015-05-12 10:38:12 +02:00
Yohan Boniface
298a27fbe4 Add Polyline/Polygon.isEmpty method 2015-05-09 23:03:22 +02:00
Yohan Boniface
426f331874 Fix polygon.addTo(map) failing when latlngs was empty.
Since #3279 an empty polygon as a nested array [[]] as latlngs,
so _latlngs.length returns true.
2015-05-09 22:04:46 +02:00
Vladimir Agafonkin
7603010f8b Merge pull request #3279 from Leaflet/nested-polygons
Ensure polygons latlngs are never flat (cf #2618)
2015-05-08 16:01:56 +03:00
Yohan Boniface
6aca7ef3c2 Add back L.Polyline.addLatLng 2015-05-08 14:53:21 +02:00
i.taratuhin
57d7dff81f fix vector in ie8 2015-05-08 18:03:24 +06:00
Yohan Boniface
2408cf2bb6 _flat is now a static method 2015-05-08 13:11:58 +02:00
Yohan Boniface
8b97b905e8 Merge branch 'master' into nested-polygons 2015-05-08 13:10:49 +02:00
Yohan Boniface
d53d958e81 Simpler approach for static method 2015-05-08 12:01:22 +02:00
Yohan Boniface
19d6008dfc Make L.Polyline._flat a static method 2015-05-08 11:52:00 +02:00
Yohan Boniface
8938754bd5 Merge branch 'master' into nested-polygons
Conflicts:
	spec/suites/layer/vector/PolygonSpec.js
2015-04-21 15:57:24 +02:00
Yohan Boniface
003e94ae11 Fix L.Polyline._flat returning true for a nested empty array 2015-04-18 17:41:36 +02:00
Yohan Boniface
3336bcbbe9 Fix Polygon.getCenter returning invalid LatLng when all points in same pixel 2015-04-12 18:43:04 +02:00
Yohan Boniface
a82c80ecd9 Fix Polyline.getCenter returning undefined with very small line 2015-04-12 11:25:46 +02:00
Yohan Boniface
0d0269ac15 Remove Polyline.addLatLng and Polyline.spliceLatLngs
Those method are not consistent (or too complexe) among
the supported Polygon/Polyline (cf #3279)
2015-03-06 09:05:50 +01:00
Yohan Boniface
602cff077f Ensure polygons latlngs are never flat (cf #2648) 2015-03-04 18:14:51 +01:00
Vladimir Agafonkin
0a68b25ce5 fix Canvas vector events 2015-03-02 19:03:38 +02:00
Vladimir Agafonkin
8e7bbff6d8 switch SVG paths to new delegation API 2015-03-02 19:03:38 +02:00
Vladimir Agafonkin
954ef1cc10 add indent eslint rule and fix some whitespace 2015-03-01 12:01:28 +02:00
Jake Wilson
d0b5aada79 Code consistency changes 2015-02-28 21:26:20 -07:00
Jake Wilson
8c30707e56 Fixed some code style issues. 2015-02-28 21:21:45 -07:00
Jake Wilson
721cf6a689 Added ability to specify pane for vector layer creation, which will automatically create a renderer for that pane if one does not already exists. 2015-02-28 20:48:14 -07:00
Vladimir Agafonkin
54c712cf2b Merge pull request #2926 from aparshin/clip-round
Add optional parameter for result rounding in L.PolyUtil.clipPolygon and L.LineUtil.clipSegment
2015-02-06 17:42:53 +02:00
Jared
ff679aa7dc Do not render the stroke if the weight is explicitly set to 0
When rendering to SVG, if the weight is 0 the outline is not displayed.
However, when rendering to canvas it will still display the outline.
This change makes the behaviour consistent when rendering to either.
2015-02-06 11:41:40 +13:00
Vladimir Agafonkin
e749d1915b add ESLint rules; various code style fixes 2015-01-28 17:27:31 +02:00
kerryarts
0daf28fb4f Fix _bringToFront/Back implementation for VML renderer 2014-11-21 09:41:02 +13:00
Fabian Zeindl
4f06ac30b0 Don't append/remove the SVG container
Tested this on IOS7, which has 85% adoption and I see no flicker.
Reduces layout and paint-times.
2014-11-05 18:19:35 -08:00
John Firebaugh
ea2c397523 No-op bringToFront/Back when Path is not on a map (fixes #2439) 2014-11-05 15:13:28 -08:00
Vladimir Agafonkin
de4910f407 use offset when animating transform to avoid dividing by zero 2014-10-21 12:21:28 +03:00
Vladimir Agafonkin
fc05abd336 Merge pull request #2834 from bullgare/path_svg_fill_rule
svg's attribute 'fill-rule' now can be set via options into either 'evenodd' or 'nonzero'
2014-10-20 13:18:30 +03:00
bullgare
809844b539 svg's attribute fill-rule supports two values: 'evenodd' and 'nonzero'. now for canvas, too. 2014-10-20 10:24:11 +04:00
Alexander Parshin
3a5d45d62e Add optional parameter for result rounding in L.PolyUtil.clipPolygon and L.LineUtil.clipSegment 2014-09-30 09:57:53 +04:00
AndreyGeonya
9445c2f9f2 this commit fixes #2499 2014-08-05 18:14:02 +03:00
bullgare
38476615e6 svg's attribute fill-rule supports two values: 'evenodd' and 'nonzero'. now we can set it via options and it's not hardcoded. https://developer.mozilla.org/ru/docs/Web/SVG/Attribute/fill-rule 2014-08-05 17:37:20 +04:00
Vladimir Agafonkin
93cf8d7e95 Merge pull request #2605 from danzel/vmlfix
Round point so that circles work again :)
2014-07-30 13:58:39 +03:00
Fabian Zeindl
132e5b6f7c Performance: don’t set width/height on SVG if unchanged. Saves a costly layout/repaint in some situations. 2014-06-17 15:39:58 +02:00
Vladimir Agafonkin
b16daa39b9 fix rare error when dragging vectors, close #2706 2014-05-26 18:52:24 +03:00
danzel
1f08c65794 Round point so that circles work again :) 2014-04-02 10:40:42 +13:00
Dmitry Lutsik
67100000fa proper svg pointer-events value 2014-03-28 15:23:11 +02:00
AndreyGeonya
52fff05eb8 circle marker radius redrawing fixed 2014-03-24 19:20:34 +02:00
Vladimir Agafonkin
b626553bc2 Merge pull request #2524 from jeffsmale90/dasharray-offset
Added Dasharray offset
2014-03-19 11:56:15 -07:00
Jeff Smale
17434c5b0c Renamed dashArrayOffset to dashOffset for consistency 2014-03-17 12:54:22 +13:00
Vladimir Agafonkin
b8897f26fb instantiate default renderers in map, fix #2523 2014-03-07 14:52:11 +02:00
Jeff Smale
d05a049dde Fixed indentation of dasharrayoffset code 2014-03-07 12:35:49 +13:00
Jeff Smale
b1e08ab8c2 Added stroke-dashArray to path options 2014-03-07 11:50:44 +13:00
Vladimir Agafonkin
f8ee421ca4 Merge pull request #2419 from danzel/vector-during-zoom
Fix adding Vector layers during a zoom animation
2014-02-27 17:28:09 +02:00
Vladimir Agafonkin
860fb92461 Merge pull request #2418 from danzel/ie8-fixes
IE8 fixes.
2014-02-27 17:27:44 +02:00
Vladimir Agafonkin
f574bf5114 Merge pull request #2482 from perliedman/canvas-update-2476
Call layer's _update like SVG renderer does, fixes #2476
2014-02-22 16:49:49 +02:00
Per Liedman
501d61ce98 Call layer's _update like SVG renderer does, fixes #2476 2014-02-22 13:31:13 +01:00
Alexander Dimitrov
687c0b75a4 Move _containsPoint method to CircleMarker for canvas renderer
CircleMarker is the parent of Circle as of 508a75f7a8 and should have _containsPoint instead.
Fixes no method '_containsPoint' error when hovering on a map with a CircleMarker.
2014-02-22 00:24:15 +02:00
danzel
4a556886fb Fix adding Vector layers during a zoom animation. Fixes #2416 2014-01-30 11:14:57 +13:00
danzel
4e84f9ec1f IE8 fixes.
Events on VML elements actually work :)
2014-01-30 11:12:07 +13:00
Vladimir Agafonkin
9020f4d41e greatly simplify zoom animation calculations - finally!!! 2014-01-15 17:15:52 +02:00
Vladimir Agafonkin
f32173573a do not stack transforms for real now, close #1705 2014-01-13 17:10:58 +02:00
Vladimir Agafonkin
6f5c17fae0 more consistent renderer anim calculations 2014-01-10 21:59:25 +02:00
Vladimir Agafonkin
d22f75cc36 simpler renderer zoom anim 2014-01-10 20:19:01 +02:00
Vladimir Agafonkin
758679ab69 add DomUtil.setTransform for translate+scale ops 2014-01-10 16:05:58 +02:00
Vladimir Agafonkin
be85ff304c fix Canvas layer redawing 2014-01-03 20:14:24 +02:00
Vladimir Agafonkin
ae8bc579a4 fix Circle in flat projections 2014-01-03 18:08:19 +02:00
Vladimir Agafonkin
8f4baaed14 don't render circles near poles or with 0 radius 2014-01-03 17:37:51 +02:00
Vladimir Agafonkin
192973093f fix ellipse disappearing with big radiusY 2014-01-03 15:27:18 +02:00
Vladimir Agafonkin
06fb3ce6e4 much better circle approximation near poles 2014-01-03 03:50:22 +02:00
Vladimir Agafonkin
7ff0fa9c72 approximate Circle with ellipse 2014-01-03 00:37:34 +02:00
Vladimir Agafonkin
c4a9418d3b add low level ellipse rendering support 2014-01-02 20:36:47 +02:00
Vladimir Agafonkin
6940b5bac9 use projected coordinates in Circle, close #1465 2014-01-02 15:23:28 +02:00
Vladimir Agafonkin
dd1b9617dd add syntactic sugar to DomEvent.on/off 2013-12-30 17:40:23 +02:00
Vladimir Agafonkin
6cea376807 add missing Canvas events, fix mouseover spam 2013-12-30 13:22:14 +02:00
Vladimir Agafonkin
ee3f2f8b1e stop propagation explicitly; marker and vector mouseup
this way we know what events won’t propagate to Map and this behavior
is consistent across layers
2013-12-28 03:12:18 +02:00
Vladimir Agafonkin
93214d7e3c clean up mouse events handling code 2013-12-27 18:36:24 +02:00
Vladimir Agafonkin
3ae769a4e7 pass options in canvas/svg factories 2013-12-23 22:39:42 +02:00
Vladimir Agafonkin
bc405b5911 make propagation work correctly for vector layers 2013-12-23 21:33:25 +02:00
Vladimir Agafonkin
5d9cc6bf47 optimize canvas implementation further 2013-12-23 16:55:12 +02:00