Git Product home page Git Product logo

google-map-area-editor's Introduction

google-map-area-editor

Project setup

yarn install

Compiles and hot-reloads for development

yarn serve

To save polygon geometry click it again after edit.

After the map is being loaded all polygons are set on the map, but only part if them is made visible. The box (region), containing all polygons is detected and is being divided into 25 parts (configurable). Then the box for every polygon is calculated and polygons are assigned to the regions. The visible regions are detected and only the polygons that belong to the visible regions are shown.

On user interactions (drag end and zoom change) the visible regions are recalculated and the polygons, which belong to visible regions are set as visible.

The center of the map is set as a center of the box containing all polygons. When the user hovers over the polygon it is being highlighted in white with black border and the corresponding row in table on the right is highlighted. I show only first 25 entries in the table (I think the pagination is needed).

When the user clicks on the polygon the polygon is being set editable and the corresponding entry in the table is moved to the beginning of the list.

I think the map is rendering and rerendering is rather fast due to the optimization with dividing the map into regions. That allows to narrow the recalculations needed for map redraw.

For the future improvements I would list:

  • use polygons with simplified geometry to display map on higher zoom levels
  • combine google.map.Polygons with data layers
  • getting rid of vuex, which is happened to be very slow on big arrays (even for frozen and not associated with DOM nodes). The state mutations took a lot of time that's why I got rid of most of them and moved them into custom state without vuex.

google-map-area-editor's People

Contributors

kaciaryna avatar

Watchers

James Cloos avatar  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.