SDKstatelessdeprecated

Mapmyindia Vector Maps JS Web SDK

mapmyindia-vector-maps-js-web-SDK

MapmyIndia's Latest Vector Maps Web SDK for rendering beautifully interactive, fluid maps that are powered by browser based WebGL.

Integration notice

This source is classified as deprecated. Use it for migration context and verify the supported replacement before new development.

Migration plan available

This source is covered by a gated upgrade journey with candidate evidence, compatibility checks, parity proof, production acceptance, and rollback. Open Web maps and plugins: legacy scripts to a governed browser boundary

What this surface enables

MapmyIndia's Latest Vector Maps Web SDK for rendering beautifully interactive, fluid maps that are powered by browser based WebGL.

Why this source is classified stateless

No durable provider record or application workflow contract was established from the source identity or bounded document evidence; view, camera, callback, and authentication sessions alone do not make a source stateful.

Authority: Conservative Default · No durable-state signal promoted from incidental vocabulary
Platforms

Web

Product areas

MapsSearch PlacesRoutes NavigationGis AnalyticsWidgets Deep Links

Languages found

HTMLTextJavaScript

Authentication signals

Api Key

Prepare the integration

  1. A browser application and an allowed development origin
  2. A Mappls project key restricted to the intended app, domain, or backend
Production guardrailsPin package versions and record the source fingerprint.Keep server credentials out of client binaries and logs.Test failures, timeouts, quota limits, upgrades, and rollback.Validate legacy examples against current authentication contracts.

Setup and usage examples

These examples were extracted from the canonical public source document and sanitized for credential-like values. Check the source branch and package version before copying into a production application.

mapmyindia-vector-maps-js-web-SDK examples
<script src="https://apis.mappls.com/advancedmaps/api/<key or token>/map_sdk?v=3.0&layer=vector"></script>

Topics documented by the source

01DEPRECATED

This repository is no longer in active development & use.

02MapmyIndia Interactive Vector Maps JS SDK for Web !

Explore the largest directory of APIs & SDKs for maps, routes and search.

Our APIs, SDKs, and live updating map data available for 238 nations give developers tools to build better mapping, navigation, and search experiences across platforms.

This page will be continually enhanced to offer more insights and reference material on how to best utilize our Vector Maps JS SDK for Web.

You can get your api key to be used in this document here: https://apis.mappls.com/console/

03Introduction

The Interactive Maps JavaScript SDK for Web helps render and display map tiles while customizing the map's look and feel on mobile or web browser. Mappls (MapmyIndia) is India's leading Map provider, and produces various SDKs, including Web SDKs (JavaScript libraries) for mobile-friendly interactive maps which are easy to use & high on performance. This SDK is a collection of classes and functions that can be used to implement a host of map features.

• Zoom: Pan-able map of India with 19 zoom levels, 22 being the highest (most detailed) and 4 being the lowest (country level) map display. - Overlays: The map is the key for any sort of business and understanding this, we at Mappls provide quick default overlays to reduce the boiler plate code for your code base. - Map Markers (Pushpins): Point to any location using default pushpin behaviors and provide it your own style to make it look more tailored for your application. Note: Have a look at the Plug-ins section to find out what makes it cooler. - Info Windows (Pop-ups): On a Map Clicking is a native behavior understanding this, we provide out of the box info windows such that if a pushpin is clicked an info window pops up open and you can show your content related to that location there. You can style it to make it behave as required for your UI to be magnificent. - Polylines: Connect

Note: The location settings must be turned on and must allow the site to fetch the location for this control to work.

Please Note: Mappls(MapmyIndia) may extend and enhance functionality for its interactive map API in future, which will be clearly documented in this section, and which will be available through the Mappls.Map class and Mappls. set of classes generally.

04Getting Started

Now that you’re all caught up with the features let’s get down right to them and look at how can you integrate our Interactive Map to your Website from scratch.

05Initializing The Map

The easiest way to start loading maps in a web page is with a “Hello World” sample code, you can download or view a working “Hello World” sample from the links for adding your first marker below.

06Adding the Map Script to your web page

Follow the below steps to integrate MapmyIndia interactive Maps into your existing code base or even a File -> New Project. - Declare application as HTML5: Define on top of your HTML. - Integrate Interactive maps from Mappls into your browser application by simply including Mappls's interactive map API in your script source in the head section.

• bearer token in place of - layer: Vector/raster default vector

• Define a style in the head section to load in your CSS.

• Define a div object in the body tag of the HTML where you want the Mappls Map to show up.

• Initialize a Mappls Map by simply calling new Mappls.Map() in the JavaScript and passing it at the minimum, the div object in which you want the map populated. (All other parameters are optional.)

07Map Quick Reference:

• Map Methods & Events - Map Properties - Map Methods - Map Events

08Markers

Markers are effortless way of pointing to a location, so getting right to it, you can go ahead and add markers that we provide out of the box but just in case you want to add your own, we’ve got that covered for you as well. There are 3 main categories of markers that you can add namely, - Stock Markers: The one you get out of the box using our Interactive Vector Maps SDK and you can select from a lot of choices. - Custom Marker: Just in case you want to provide your own markers, we’ve handled that for you as well. - HTML Marker: In case you don’t want to add in an image you can use HTML to create a marker and then plot it on the map as well.

For more details, please read article in Markers

Now, that you have a basic understanding of Markers, Functions and Events let’s talk about Info Windows or Pop-Ups.

09Adding Your First Marker

The easiest way to start loading maps with simple markers in a web page is with a “Hello World” sample code, you can download or view a working “Hello World” sample from the links above.

In the sample, we have a case of a map scenario where objective is plotting a pushpin that says hello world on click.

10Method to add marker on map

##### Code to add marker on Map

11Knowing Properties And Methods

You can interact with properties of the Map we provide to suite your use case and add additional customizability to your Map layer using the features it has to offer. These functions are a quick go to in case of an event.

For details, please read article in Marker Methods

12Marker Quick Reference:

• Marker Properties - Marker Methods - Marker Events

• Multiple Marker with cluster

• GeoJSON Bulk Marker

13Info Windows

Info Windows are a convenient way of showing data about a marker or in simple words: what that marker stands for. The Native behaviour of a user to know about any marker is to try and click on it to know what it’s all about and showing an info window would be the way to go about it:

Please Note: MapmyIndia interactive map SDK supports a default info window that you can leverage but we want you to have an option to customize your info window to fit in with your UI and you can do so in the CSS.

For a quick sample or a demo you can follow up with the links on top.

You can declare an info window in your CSS and write up a quick function to generate data in that info window and on marker click event simple open that info window.

For details , please read article in Info Windows

14Info Window Quick Reference

• InfoWindow Properties

• Remove InfoWindow

15Polylines

Polylines are a way of showing movement or transit on a map. We at Mappls understand the ways you can leverage the features offered by a map and one among them is a Polyline.

Polylines are continuous lines consisting of one or more line segments (preferably a geopath). To add a polyline, initialize map as shown in the previous sections and then create a data set. What is a data set? The Data set is the collection of points (latitude and longitude) over which you want the polyline to be drawn.

For details , please read article in Polylines

16Polyline Quick Reference

• Polyline Properties

17Example:

• Draw Editable Polyline

Drag polyline from anywhere & get callback polyline data. By default the value is false.

• Draw Gradient In Polyline

• Draw Animated Polyline

Polyline draw point by point with speed

• Animated Marker Along With Polyline

18Polygons

Polygons are a way of showing a territory. In cases where you want to showcase data over an area, polygons are your best pick. You can use them to show Geozones as well.

It’s very like generating a polyline, the basic steps remain the same, create a Data set, generate a polygon and add it to the map.

For details , please read article in Polygon

19Example

• Polygon Properties

20Draw Polyline/Polygons

This method can draw polyline or polygon directly from map with click event with callback methods.

Double Click to finish draw event.

Now that we’ve covered polygons let’s have a look at Circles which provide another way of showcasing territory.

21Circles

Circles are way of marking a territory without too much interaction by the user. A circle only has two important values:

• The Centre point of the circle (in this case it’ll be a latitude with a longitude). - The Radius of the circle.

With the two values, you can easily define a quick area of interest on a map.

For details , please read article in Circle

22Example

• Circle Properties

23Heatmap Overlays

For details , please read article in Heatmap Overlays

• Heatmap Properties

24Add geojson layer

For details, please read article in GeoJSON

GeoJSON Supports marker, polyline and polygon

Marker Property support in geojson

1. description 2. icon 3. icon-size 4. icon-offset 5. text 6. text-size 7. text-offset

polyline Property support in geojson:

1. stroke 2. stroke-opacity 3. stroke-width

Service references found

URLs are sanitized during ingestion and may include documentation or legacy hosts. Use them to trace the source, not as a substitute for the current API contract.

https://github.com/MapmyIndia/mapmyindia-rest-api/blob/master/docs/countryISO.mdhttps://apis.mappls.com/console/](https://apis.mappls.com/console/https://github.com/mamtasharma117https://www.mapmyindia.com/api/advanced-maps/WebSDK-LiveDemo/mapInitializationhttps://apis.mappls.com/advancedmaps/api/https://github.com/mappls-api/mapmyindia-vector-maps-js-web-SDK/blob/master/docs/V3.0/mapProperties.mdhttps://github.com/mappls-api/mapmyindia-vector-maps-js-web-SDK/blob/master/docs/V3.0/mapMethods.mdhttps://github.com/mappls-api/mapmyindia-vector-maps-js-web-SDK/blob/master/docs/V3.0/mapEvents.mdhttps://github.com/mappls-api/mapmyindia-vector-maps-js-web-SDK/blob/master/docs/V3.0/markers.mdhttps://www.mapmyindia.com/api/advanced-maps/WebSDK-LiveDemo/single-markerhttps://github.com/mappls-api/mapmyindia-vector-maps-js-web-SDK/blob/master/docs/V3.0/markerMethods.mdhttps://github.com/mappls-api/mapmyindia-vector-maps-js-web-SDK/blob/master/docs/V3.0/markerProperties.mdhttps://github.com/mappls-api/mapmyindia-vector-maps-js-web-SDK/blob/master/docs/V3.0/markerEvents.mdhttps://github.com/mappls-api/mapmyindia-vector-maps-js-web-SDK/blob/master/docs/V3.0/markers.md#Multiple-Marker-With-clusterhttps://github.com/mappls-api/mapmyindia-vector-maps-js-web-SDK/blob/master/docs/V3.0/markers.md#geojson-bulk-markershttps://apis.mappls.com/map_v3/1.png',clusters:true,fitbounds:true,fitboundOptions:%7Bpadding: