Comments (4)
And I just noticed that if I use safeLoad: true && scaleMap: false, then it doesn't recalculate the coords. Thanks again!
from imagemapster.
No worries. Is this safari or a different browser? It will try to recalculate the areas whenever it thinks that the image isn't being shown in its native size. it sounds like this is related to an early-binding problem and the width/height are zero. It shouldn't be even checking that yet, as it should still be in the load loop. In my attempts to fix this before, I am not sure I even realized it was recalculating the areas - this could be a key to a way around this. It sounds like the "load" event is being fired, or some other indicator that the image is loading, is presenting before the effective height/width are available, so maybe I can check for those too (in addition to "complete", "onload", "naturalWidth.." .. it's a little ridiculous how hard this it to do :)
Anyway the safeLoad thing will not work for dynamic loads because it simply waits for window.onload which has already come and gone in that situation. The actual demo page on the web site suffers from this exact problem on Safari, as it too is loaded dynamically. I have hacked it to simply reload itself (so the inner content is loaded with the page instead of through ajax) when it detects Safari as a workaround. Not a great solution but I still haven't been able to figure out something that works reliably on Safari as yet.
I would love to be able to figure out a robust solution for this problem, if you have looked at the change log, you can see it has been a huge thorn in my side.
Anyway -- can you post a link to an example where you're having this problem? Maybe it will give me some more information that I'm not seeing in my own use case.
from imagemapster.
Just saw your update - yeah scaleMap: false will stop that - but still sounds like it's binding early, could cause other problems. If you have a public link to the broken version I'd be interested in looking at it.
from imagemapster.
Just figured out one part of the safari problem: even for cached images, it doesn't necessarily let you access a copy right away, so I set up a callback for that, too, when testing the native size. This should fix the "infinity" issue.
However there is a separate issue when loading asynchronously, at least in my use case:
http://www.outsharked.com/test/imagemapster/default.aspx?demos.html
Direct load works now (it used to not work before the images were cached). Navigate away & back, though, and it doesn't bind properly when loading async, but no errors. Only in safari.
I would be interested to know if this code (beta 23) solves your problem with scaleMap: true
from imagemapster.
Related Issues (20)
- Visual 'selection' cannot be removed via API when `staticState === true`
- area w/ `staticState === false` that has been selected via API becomes unselected when clicking another area
- `select`/`set` options not applied or not applied correctly
- Change tooltips dinamically HOT 1
- singleSelect not respected when `selected` === true on map config and/or multiple area config HOT 1
- Rename default branch to main HOT 4
- Uncaught RangeError: Maximum call stack size exceeded when includeKeys has circular reference
- Inconsistent/Unexpected behavior when clicking area that has includeKeys
- onConfigured not called after rebind
- areas appears selected in UI after rebind even though its selected state !== true HOT 1
- some options (e.g. wrapClass) are not applied after rebind
- onGetList not called when isSelectable !== true
- tests not waiting for onConfigured before continuing
- [📘] rebind docs are not correct regarding preserving selected state
- jsFiddle demos are all broken HOT 6
- Incorrect reference to navigateMode config option name
- Safari's OCR/Live Text is blocking image zones HOT 3
- [TouchScreen only] Weird highlight glitch when touch on the other area beside the map. HOT 5
- this.activeToolTip.stop is not a function HOT 2
- Export image HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagemapster.