Draw Rectangle on any map


#1

How to add a functionality on a map using javascript that enables draw shapes like rectangle on the map ?


#2

Are you drawing on a canvas?


#3

No sir I want to create a webapi that enables drawing shapes on maps
something like this :- http://openlayers.org/en/latest/examples/draw-shapes.html


#4

That is a canvas.

Is that the map you’re dealing with? How to draw things on a map depends entirely on the map.


#5

I have previously worked on Google maps to draw shapes on their map system.
It´s well documented: https://developers.google.com/maps/documentation/javascript/shapes


#6

You have to tell us more about your map and your web API.
Is it an external map source or did you create your own?
Remember that you can still use canvas to draw things on top of things. You simply have to create a javascript package/module that the programmer can interact with (API =) )


#7

the map is from an external source.


#8

the map that I will be using is this:- https://maps.mapmyindia.com/@jqiofalfl,ooilfjavf,lj,l,f,fzdata
API of this map is available to me from the website.


#9

You’ll need to refer to that API to know what drawing capabilities are available to you to use.