Giter Site home page Giter Site logo

osd-royho-2011 / image-map-creator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from n-peugnet/image-map-creator

0.0 0.0 0.0 15.12 MB

A javascript tool to create image map that you can export in HTML or SVG

Home Page: https://n-peugnet.github.io/image-map-creator/

License: MIT License

JavaScript 1.59% TypeScript 98.41%

image-map-creator's Introduction

This is a simple map creator tool made with the p5.js library. I want it to be easy to use for both the end user and the developper. This work is still in beta so a lot of things are about to change (including the save file's structure).

demo gif

Live demo

the live demo can be tried here : https://n-peugnet.github.io/image-map-creator/

Features

Here is the list of all the features of this app :

The checked ones are implemented, the others are the ones I plan to add in the future.

  • drag&drop on the canvas
    • a picture
    • a .map.json save file
  • zoom in & out by scrolling
  • pan with center click
  • show a menu by right-clicking on an area with these options :
    • set url
    • set title
    • delete
    • move forward
    • move backwards
  • differents tools :
    • rectangle mode
    • circle mode
    • polygon mode
    • select mode :
      • move an area
      • move a point of an area
      • multiselect with shift
    • delete mode
    • test mode
  • differents drawing modes for rectangles :
    • dram from edges
    • draw from center (with alt)
    • draw square (with shift)
  • differents drawing modes for circles :
    • draw from edges
    • draw from center (later with shift)
  • gui with these features :
    • select tool mode
    • undo
    • redo
    • export the result as a valid html map
    • export the result as a usable svg map
    • export the result as JSON
    • import from JSON

Integration

There are multiple ways to get image-map-creator:

  • Download the bundle from the latest release.
  • Compile the bundle from sources (see development informations).
  • Get the package from npm:
    npm install image-map-creator
    
    // script.js
    import { imageMapCreator } from "image-map-creator";

Import p5.js, p5.dom.js and the javascript bundle from /dist :

<script src="dist/image-map-creator.bundle.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/addons/p5.dom.min.js"></script>

Add a <div> with an id, then instantiate the p5 object like this :

let iMap = new imageMapCreator("div-id");

The contructor of imageMapCreator accepts these parameters :

new imageMapCreator(elementId [, width = 600 [, height = 450 ]]);

You can also see the detailled example in the /demos folder.

Development

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  1. Git
  2. Nodejs & NPM

Install & Run

  1. clone with --recurse-submodules option or download this repository and install git submodules :
    git submodule init
    git submodule update
  2. install dependencies :
    npm install
  3. launch webpack in watch mode to build the dev bundle :
    npm run watch
  4. navigate to demos/index.html with you browser

Built with

Authors

See also the list of contributors who participated in this project.

image-map-creator's People

Contributors

n-peugnet avatar dependabot[bot] avatar fossabot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.