Comments (3)
Hi,
I'm not sure I understand the question, you can attach your code to this topic, and I will try to resolve this problem.
from summer.
Thanks for your reply.
So I have modified the localStorageWrapper so instead of saving/reading from local storage it now saves the coordinates in a database.
This works and I am able to save and load successfully.
I have also replaced the url/drag and drop section for loading images with a select menu of predefined images, this also works as expected.
What I would like is for the restore function to fire as soon as an image has been selected and loaded onto the canvas, instead of having to click 'load'.
When I tried this however it kept loading the hotspots in a loop and layering them on top of eachother.
I hope this makes sense, let me know if you need to see any more code.
Thanks
#loadurl is a hidden field with the filename of the image which is currently loaded into the canvas
var localStorageWrapper = (function() {
var KEY_NAME = 'SummerHTMLImageMapCreator';
return {
save : function() {
var result = areasIO.toJSON();
console.log(areasIO);
$.ajax({
url: 'savedata.php',
type: 'post',
data: {model:KEY_NAME,result:result},
success: function(data){
console.info('Saved in Database');
alert('Saved');
}
});
},
restore : function() {
var namefromfield=$("#loadurl").val();
namefromfield=namefromfield.split('|');
var imgurl=namefromfield[0];
var getmodelname=namefromfield[1];
$.ajax({
url: 'getdata.php',
type: 'post',
data: {imgurl:imgurl,model:getmodelname},
success: function(data){
console.log(data);
areasIO.fromJSON(data);
}
});
}
};
})();
from summer.
I need to see all changes, incl. menu of predefined images
from summer.
Related Issues (20)
- reload previously drawn maps HOT 4
- Use App.js
- Can We Have To SVG Button HOT 2
- TODO for 1.0.0
- Hotspots can be moved outside image boundaries HOT 3
- Rectangle resize does not fit edges properly HOT 1
- Helper attributes
- URL link from Google Drive
- close button
- problem with from html HOT 2
- No problem really
- Mobile version? HOT 1
- Edit mode - helpers
- Summer html Image map creator customization HOT 10
- Questions about licensing HOT 3
- Up arrow in edit mode not working HOT 1
- How to make drawn area into textbox css? HOT 6
- While in edit mode, how to select multiple area items and drag up/down? HOT 6
- image link not complete in HTML generation 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 summer.