Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-azure-maps

Package Overview
Dependencies
Maintainers
0
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-azure-maps - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

dist/react-azure-maps.es5.js

@@ -1,1 +0,1 @@

import e,{createContext as t,useState as r,useContext as o,useEffect as n,memo as a,useRef as s}from"react";import i from"azure-maps-control";export{AuthenticationType}from"azure-maps-control";import{Guid as c}from"guid-typescript";import{renderToStaticMarkup as l}from"react-dom/server";const u=t({mapRef:null,isMapReady:!1,setMapRef:e=>{},removeMapRef:()=>{},setMapReady:()=>{}}),{Provider:p,Consumer:d}=u,m=({children:t})=>{const[o,n]=r(null),[a,s]=r(!1);return e.createElement(p,{value:{mapRef:o,setMapRef:n,isMapReady:a,setMapReady:s,removeMapRef:()=>n(null)}},t)},y=()=>o(u);function f(e,t,r){n((()=>{if(e&&t)return r(e,t)}),[t])}function v(e,t,r){n((()=>{if(e&&t)return r(e,t)}),[])}const g=(e,t)=>{switch(e){case"CompassControl":return new i.control.CompassControl(t);case"PitchControl":return new i.control.PitchControl(t);case"StyleControl":return new i.control.StyleControl(t);case"ZoomControl":return new i.control.ZoomControl(t);case"TrafficControl":return new i.control.TrafficControl(t);case"TrafficLegendControl":return new i.control.TrafficLegendControl;default:console.warn("Check the type and passed props properties or try CustomControl")}},C=a((({children:t,LoaderComponent:a=(()=>e.createElement("div",null,"Loading ...")),providedMapId:l,containerClassName:p,styles:d,options:m={},imageSprites:y,controls:v,customControls:C,events:S,cameraOptions:w,trafficOptions:h,userInteraction:L,styleOptions:M,serviceOptions:P})=>{const{setMapRef:R,removeMapRef:I,mapRef:E,setMapReady:b,isMapReady:O}=o(u),[T]=r(l||c.create().toString()),z=s(null);return n((()=>{E&&E.setTraffic(h)}),[h]),n((()=>{E&&E.setUserInteraction(L)}),[L]),n((()=>{E&&E.setCamera(w)}),[w]),n((()=>{E&&E.setStyle(M)}),[M]),n((()=>{E&&P&&E.setServiceOptions(P)}),[P]),f(E,E,(e=>{e.events.add("ready",(()=>{y&&(async(e,t)=>{await Promise.all(t.map((async({id:t,templateName:r,color:o,secondaryColor:n,scale:a,icon:s})=>(s&&await e.imageSprite.add(t,s),e.imageSprite.createFromTemplate(t,r||"marker",o,n,a)))))})(e,y),v&&((e,t)=>{t.forEach((t=>{const{controlName:r,options:o,controlOptions:n}=t;e.controls.add(g(r,n),o)}))})(e,v),C&&((e,t)=>{t.forEach((({control:t,controlOptions:r})=>{e.controls.add(t,r)}))})(e,C),h&&e.setTraffic(h),L&&e.setUserInteraction(L),w&&e.setCamera(w),M&&e.setStyle(M),P&&e.setServiceOptions(P),b(!0)}));for(const t in S)e.events.add(t,S[t])})),n((()=>(null===z.current&&(z.current=new i.Map(T,{...m||{},sessionId:(null==m?void 0:m.sessionId)||`react-azure-maps:${c.create().toString()}`})),R(z.current),()=>{I()})),[]),e.createElement(e.Fragment,null,!O&&a&&e.createElement(a,null),e.createElement("div",{className:p,id:T,style:{...d,height:"100%"}},O&&t))})),S=a((({markerContent:e,options:t,events:a,isPopupVisible:s})=>{const[c]=r(new i.HtmlMarker({...t,htmlContent:e&&l(e)})),{mapRef:p}=o(u);return v(p,!0,(e=>(e.markers.add(c),a&&a.forEach((({eventName:t,callback:r})=>{e.events.add(t,c,r)})),()=>{e.markers.remove(c)}))),n((()=>{c&&p&&c.setOptions({...t,htmlContent:e&&l(e)})}),[e,t]),n((()=>{if(c&&c.getOptions().popup&&p){const e=c.getOptions().popup;s?(null==e||e.setOptions({position:c.getOptions().position}),null==e||e.open(p)):null==e||e.close()}}),[s,t,p]),null})),w=e=>new i.data.LineString(e),h=(e,t)=>i.Pixel.getHeading(e,t),L=(e,t)=>e.layers.getLayers().filter((e=>{if(e.getSource){const r=e.getSource();return("string"==typeof r?r:r.getId())===t.getId()}return!1})),M=t({dataSourceRef:null}),{Provider:P,Consumer:R}=M,I=({id:t,children:a,options:s,events:c,dataFromUrl:l,collection:p})=>{const[d]=r(new i.source.DataSource(t,s)),{mapRef:m}=o(u);return f(m,d,((e,t)=>{for(const r in c||{})e.events.add(r,t,c[r]);return e.sources.add(t),t instanceof i.source.DataSource&&(l&&t.importDataFromUrl(l),p&&t.add(p)),()=>{for(const r in c||{})e.events.remove(r,t,c[r]);L(e,t).forEach((t=>{e.layers.remove(t.getId()?t.getId():t)})),e.sources.remove(t)}})),n((()=>{d&&p&&(d.clear(),d.add(p))}),[p]),n((()=>{d&&s&&d.setOptions(s)}),[s]),e.createElement(P,{value:{dataSourceRef:d}},m&&a)},E=a((t=>{const{properties:r,id:a,variant:s="feature"}=t,{dataSourceRef:c}=o(M),[l,u]=e.useState(null),[p,d]=e.useState(null);return(({setCoords:e,setProperties:t},r,o,a)=>{f(r,a,((e,t)=>{if(e instanceof i.source.DataSource)return e.add(t),()=>{e.remove(t)};r instanceof i.source.VectorTileSource&&console.error(`Unable to add Feature(${t.id}) to VectorTileSource(${r.getId()}): AzureMapFeature has to be a child of AzureMapDataSourceProvider`)})),f(r,o,((e,t)=>{if(e instanceof i.source.DataSource)return e.add(t),()=>{e.remove(t)};r instanceof i.source.VectorTileSource&&console.error(`Unable to add Shape(${t.getId()}) to VectorTileSource(${r.getId()}): AzureMapFeature has to be a child of AzureMapDataSourceProvider`)})),n((()=>{o&&e&&o.setCoordinates(e)}),[e]),n((()=>{o&&t&&o.setProperties(t)}),[t])})(t,c,p,l),n((()=>{const e=(({type:e,coordinate:t,coordinates:r,multipleCoordinates:o,multipleDimensionCoordinates:n,bbox:a})=>{switch(e){case"Point":return t&&new i.data.Point(t);case"MultiPoint":return r&&new i.data.MultiPoint(r,a);case"LineString":return r&&new i.data.LineString(r,a);case"MultiLineString":return o&&new i.data.MultiLineString(o,a);case"Polygon":return r&&new i.data.Polygon(r,a);case"MultiPolygon":return n&&new i.data.MultiPolygon(n,a);default:console.warn("Check the type and passed props properties")}})(t);if((!l||!p)&&e)switch(s){case"shape":d(new i.Shape(e,a,r));break;case"feature":u(new i.data.Feature(e,r,a))}}),[]),null})),b=({id:t,children:n,options:a,events:s={}})=>{const[c]=r(new i.source.VectorTileSource(t,a)),{mapRef:l}=o(u);return f(l,c,((e,t)=>{for(const r in s){const o=s[r];o&&e.events.add(r,t,o)}return e.sources.add(t),()=>{for(const r in s||{}){const o=s[r];o&&e.events.remove(r,t,o)}L(e,t).forEach((t=>{e.layers.remove(t.getId()?t.getId():t)})),e.sources.remove(t)}})),e.createElement(P,{value:{dataSourceRef:c}},l&&n)},O=({id:e,options:t,type:a,events:s,lifecycleEvents:c,onCreateCustomLayer:l})=>{const{mapRef:p}=o(u),{dataSourceRef:d}=o(M),[m,y]=r(null);return f(!m,d,((...[,r])=>{let o=null;o="custom"===a?l&&l(r,p):(({id:e,options:t={},type:r},o)=>{switch(r){case"SymbolLayer":return new i.layer.SymbolLayer(o,e,t);case"HeatLayer":return new i.layer.HeatMapLayer(o,e,t);case"ImageLayer":return new i.layer.ImageLayer(t,e);case"LineLayer":return new i.layer.LineLayer(o,e,t);case"PolygonExtrusionLayer":return new i.layer.PolygonExtrusionLayer(o,e,t);case"PolygonLayer":return new i.layer.PolygonLayer(o,e,t);case"TileLayer":return new i.layer.TileLayer(t,e);case"BubbleLayer":return new i.layer.BubbleLayer(o,e,t);default:return null}})({id:e,options:t,type:a},r),y(o)})),f(p,m,((e,t)=>{for(const r in s)e.events.add(r,t,s[r]);for(const r in c)e.events.add(r,t,c[r]);return e.layers.add(t),()=>{try{e.layers.getLayerById(t.getId())&&e.layers.remove(t.getId()?t.getId():t)}catch(e){console.error("Error on remove layer",e)}}})),n((()=>{m&&t&&m.setOptions(t)}),[t]),{layerRef:m}},T=t({layerRef:null}),{Provider:z,Consumer:k}=T,V=({id:t,options:r,type:o,events:n,lifecycleEvents:a,onCreateCustomLayer:s})=>{const{layerRef:i}=O({id:t,options:r,type:o,events:n,lifecycleEvents:a,onCreateCustomLayer:s});return e.createElement(z,{value:{layerRef:i}})},A=({options:e,popupContent:t,isVisible:a})=>{const[s]=r(new i.Popup({...e,content:l(t)})),{mapRef:c}=o(u);return n((()=>{s.setOptions({...e,content:l(t)}),c&&a&&!s.isOpen()&&s.open(c)}),[e,t]),s},D=a((({isVisible:e,popupContent:t,options:r,events:a})=>{const{mapRef:s}=o(u),i=A({options:r,popupContent:t,isVisible:e});return v(s,!0,(e=>(a&&a.forEach((({eventName:t,callback:r})=>{e.events.add(t,i,r)})),()=>{e.popups.remove(i)}))),n((()=>{s&&(e&&!i.isOpen()?i.open(s):s.popups.getPopups().length&&!e&&i.isOpen()&&i.close())}),[e]),null}));export{C as AzureMap,R as AzureMapDataSourceConsumer,M as AzureMapDataSourceContext,I as AzureMapDataSourceProvider,E as AzureMapFeature,S as AzureMapHtmlMarker,k as AzureMapLayerConsumer,T as AzureMapLayerContext,V as AzureMapLayerProvider,D as AzureMapPopup,b as AzureMapVectorTileSourceProvider,d as AzureMapsConsumer,u as AzureMapsContext,m as AzureMapsProvider,w as generateLinesFromArrayOfPosition,h as generatePixelHeading,y as useAzureMaps,A as useCreatePopup};
import e,{createContext as t,useState as r,useContext as o,useEffect as n,memo as a,useRef as s}from"react";import i from"azure-maps-control";export{AuthenticationType}from"azure-maps-control";import{Guid as c}from"guid-typescript";import{renderToStaticMarkup as l}from"react-dom/server";const u=t({mapRef:null,isMapReady:!1,setMapRef:e=>{},removeMapRef:()=>{},setMapReady:()=>{}}),{Provider:p,Consumer:d}=u,m=({children:t})=>{const[o,n]=r(null),[a,s]=r(!1);return e.createElement(p,{value:{mapRef:o,setMapRef:n,isMapReady:a,setMapReady:s,removeMapRef:()=>n(null)}},t)},y=()=>o(u);function f(e,t,r){n((()=>{if(e&&t)return r(e,t)}),[t])}function v(e,t,r){n((()=>{if(e&&t)return r(e,t)}),[])}const g=(e,t)=>{switch(e){case"CompassControl":return new i.control.CompassControl(t);case"PitchControl":return new i.control.PitchControl(t);case"StyleControl":return new i.control.StyleControl(t);case"ZoomControl":return new i.control.ZoomControl(t);case"TrafficControl":return new i.control.TrafficControl(t);case"TrafficLegendControl":return new i.control.TrafficLegendControl;default:console.warn("Check the type and passed props properties or try CustomControl")}},C=a((({children:t,LoaderComponent:a=()=>e.createElement("div",null,"Loading ..."),providedMapId:l,containerClassName:p,styles:d,options:m={},imageSprites:y,controls:v,customControls:C,events:S,cameraOptions:w,trafficOptions:h,userInteraction:L,styleOptions:M,serviceOptions:P})=>{const{setMapRef:R,removeMapRef:I,mapRef:E,setMapReady:b,isMapReady:O}=o(u),[T]=r(l||c.create().toString()),z=s(null);return n((()=>{E&&E.setTraffic(h)}),[h]),n((()=>{E&&E.setUserInteraction(L)}),[L]),n((()=>{E&&E.setCamera(w)}),[w]),n((()=>{E&&E.setStyle(M)}),[M]),n((()=>{E&&P&&E.setServiceOptions(P)}),[P]),f(E,E,(e=>{e.events.add("ready",(()=>{y&&(async(e,t)=>{await Promise.all(t.map((async({id:t,templateName:r,color:o,secondaryColor:n,scale:a,icon:s})=>(s&&await e.imageSprite.add(t,s),e.imageSprite.createFromTemplate(t,r||"marker",o,n,a)))))})(e,y),v&&((e,t)=>{t.forEach((t=>{const{controlName:r,options:o,controlOptions:n}=t;e.controls.add(g(r,n),o)}))})(e,v),C&&((e,t)=>{t.forEach((({control:t,controlOptions:r})=>{e.controls.add(t,r)}))})(e,C),h&&e.setTraffic(h),L&&e.setUserInteraction(L),w&&e.setCamera(w),M&&e.setStyle(M),P&&e.setServiceOptions(P),b(!0)}));for(const t in S)e.events.add(t,S[t])})),n((()=>(null===z.current&&(z.current=new i.Map(T,{...m||{},sessionId:(null==m?void 0:m.sessionId)||`react-azure-maps:${c.create().toString()}`})),R(z.current),()=>{I()})),[]),e.createElement(e.Fragment,null,!O&&a&&e.createElement(a,null),e.createElement("div",{className:p,id:T,style:{...d,height:"100%"}},O&&t))})),S=a((({markerContent:e,options:t,events:a,isPopupVisible:s})=>{const[c]=r(new i.HtmlMarker({...t,htmlContent:e&&l(e)})),{mapRef:p}=o(u);return v(p,!0,(e=>(e.markers.add(c),a&&a.forEach((({eventName:t,callback:r})=>{e.events.add(t,c,r)})),()=>{e.markers.remove(c)}))),n((()=>{c&&p&&c.setOptions({...t,htmlContent:e&&l(e)})}),[e,t]),n((()=>{if(c&&c.getOptions().popup&&p){const e=c.getOptions().popup;s?(null==e||e.setOptions({position:c.getOptions().position}),null==e||e.open(p)):null==e||e.close()}}),[s,t,p]),null})),w=e=>new i.data.LineString(e),h=(e,t)=>i.Pixel.getHeading(e,t),L=(e,t)=>e.layers.getLayers().filter((e=>{if(e.getSource){const r=e.getSource();return("string"==typeof r?r:r.getId())===t.getId()}return!1})),M=t({dataSourceRef:null}),{Provider:P,Consumer:R}=M,I=({id:t,children:a,options:s,events:c,dataFromUrl:l,collection:p})=>{const[d]=r(new i.source.DataSource(t,s)),{mapRef:m}=o(u);return f(m,d,((e,t)=>{for(const r in c||{})e.events.add(r,t,c[r]);return e.sources.add(t),t instanceof i.source.DataSource&&(l&&t.importDataFromUrl(l),p&&t.add(p)),()=>{for(const r in c||{})e.events.remove(r,t,c[r]);L(e,t).forEach((t=>{e.layers.remove(t.getId()?t.getId():t)})),e.sources.remove(t)}})),n((()=>{d&&p&&(d.clear(),d.add(p))}),[p]),n((()=>{d&&s&&d.setOptions(s)}),[s]),e.createElement(P,{value:{dataSourceRef:d}},m&&a)},E=a((t=>{const{properties:r,id:a,variant:s="feature"}=t,{dataSourceRef:c}=o(M),[l,u]=e.useState(null),[p,d]=e.useState(null);return(({setCoords:e,setProperties:t},r,o,a)=>{f(r,a,((e,t)=>{if(e instanceof i.source.DataSource)return e.add(t),()=>{e.remove(t)};r instanceof i.source.VectorTileSource&&console.error(`Unable to add Feature(${t.id}) to VectorTileSource(${r.getId()}): AzureMapFeature has to be a child of AzureMapDataSourceProvider`)})),f(r,o,((e,t)=>{if(e instanceof i.source.DataSource)return e.add(t),()=>{e.remove(t)};r instanceof i.source.VectorTileSource&&console.error(`Unable to add Shape(${t.getId()}) to VectorTileSource(${r.getId()}): AzureMapFeature has to be a child of AzureMapDataSourceProvider`)})),n((()=>{o&&e&&o.setCoordinates(e)}),[e]),n((()=>{o&&t&&o.setProperties(t)}),[t])})(t,c,p,l),n((()=>{const e=(({type:e,coordinate:t,coordinates:r,multipleCoordinates:o,multipleDimensionCoordinates:n,bbox:a})=>{switch(e){case"Point":return t&&new i.data.Point(t);case"MultiPoint":return r&&new i.data.MultiPoint(r,a);case"LineString":return r&&new i.data.LineString(r,a);case"MultiLineString":return o&&new i.data.MultiLineString(o,a);case"Polygon":return r&&new i.data.Polygon(r,a);case"MultiPolygon":return n&&new i.data.MultiPolygon(n,a);default:console.warn("Check the type and passed props properties")}})(t);if((!l||!p)&&e)switch(s){case"shape":d(new i.Shape(e,a,r));break;case"feature":u(new i.data.Feature(e,r,a))}}),[]),null})),b=({id:t,children:n,options:a,events:s={}})=>{const[c]=r(new i.source.VectorTileSource(t,a)),{mapRef:l}=o(u);return f(l,c,((e,t)=>{for(const r in s){const o=s[r];o&&e.events.add(r,t,o)}return e.sources.add(t),()=>{for(const r in s||{}){const o=s[r];o&&e.events.remove(r,t,o)}L(e,t).forEach((t=>{e.layers.remove(t.getId()?t.getId():t)})),e.sources.remove(t)}})),e.createElement(P,{value:{dataSourceRef:c}},l&&n)},O=({id:e,options:t,type:a,events:s,lifecycleEvents:c,onCreateCustomLayer:l})=>{const{mapRef:p}=o(u),{dataSourceRef:d}=o(M),[m,y]=r(null);return f(!m,d,((...[,r])=>{let o=null;o="custom"===a?l&&l(r,p):(({id:e,options:t={},type:r},o)=>{switch(r){case"SymbolLayer":return new i.layer.SymbolLayer(o,e,t);case"HeatLayer":return new i.layer.HeatMapLayer(o,e,t);case"ImageLayer":return new i.layer.ImageLayer(t,e);case"LineLayer":return new i.layer.LineLayer(o,e,t);case"PolygonExtrusionLayer":return new i.layer.PolygonExtrusionLayer(o,e,t);case"PolygonLayer":return new i.layer.PolygonLayer(o,e,t);case"TileLayer":return new i.layer.TileLayer(t,e);case"BubbleLayer":return new i.layer.BubbleLayer(o,e,t);default:return null}})({id:e,options:t,type:a},r),y(o)})),f(p,m,((e,t)=>{for(const r in s)e.events.add(r,t,s[r]);for(const r in c)e.events.add(r,t,c[r]);return e.layers.add(t),()=>{try{e.layers.getLayerById(t.getId())&&e.layers.remove(t.getId()?t.getId():t)}catch(e){console.error("Error on remove layer",e)}}})),n((()=>{m&&t&&m.setOptions(t)}),[t]),{layerRef:m}},T=t({layerRef:null}),{Provider:z,Consumer:k}=T,V=({id:t,options:r,type:o,events:n,lifecycleEvents:a,onCreateCustomLayer:s})=>{const{layerRef:i}=O({id:t,options:r,type:o,events:n,lifecycleEvents:a,onCreateCustomLayer:s});return e.createElement(z,{value:{layerRef:i}})},A=({options:e,popupContent:t,isVisible:a})=>{const[s]=r(new i.Popup({...e,content:l(t)})),{mapRef:c}=o(u);return n((()=>{s.setOptions({...e,content:l(t)}),c&&a&&!s.isOpen()&&s.open(c)}),[e,t]),s},D=a((({isVisible:e,popupContent:t,options:r,events:a})=>{const{mapRef:s}=o(u),i=A({options:r,popupContent:t,isVisible:e});return v(s,!0,(e=>(a&&a.forEach((({eventName:t,callback:r})=>{e.events.add(t,i,r)})),()=>{e.popups.remove(i)}))),n((()=>{s&&(e&&!i.isOpen()?i.open(s):s.popups.getPopups().length&&!e&&i.isOpen()&&i.close())}),[e]),null}));export{C as AzureMap,R as AzureMapDataSourceConsumer,M as AzureMapDataSourceContext,I as AzureMapDataSourceProvider,E as AzureMapFeature,S as AzureMapHtmlMarker,k as AzureMapLayerConsumer,T as AzureMapLayerContext,V as AzureMapLayerProvider,D as AzureMapPopup,b as AzureMapVectorTileSourceProvider,d as AzureMapsConsumer,u as AzureMapsContext,m as AzureMapsProvider,w as generateLinesFromArrayOfPosition,h as generatePixelHeading,y as useAzureMaps,A as useCreatePopup};
import React from 'react';
import { IAzureMap } from '../../types';
declare const AzureMap: React.MemoExoticComponent<({ children, LoaderComponent, providedMapId, containerClassName, styles, options, imageSprites, controls, customControls, events, cameraOptions, trafficOptions, userInteraction, styleOptions, serviceOptions }: IAzureMap) => JSX.Element>;
declare const AzureMap: React.MemoExoticComponent<({ children, LoaderComponent, providedMapId, containerClassName, styles, options, imageSprites, controls, customControls, events, cameraOptions, trafficOptions, userInteraction, styleOptions, serviceOptions }: IAzureMap) => React.JSX.Element>;
export default AzureMap;
import { IAzureCustomControls, IAzureMapControls, MapType } from '../../types';
import atlas from 'azure-maps-control';
import atlas, { ControlOptions } from 'azure-maps-control';
export declare const createMapControls: (mapRef: MapType, controls: IAzureMapControls[]) => void;
export declare const createControl: (type: string, options?: atlas.ControlOptions | undefined) => atlas.control.ControlBase | undefined;
export declare const createControl: (type: string, options?: ControlOptions) => atlas.control.ControlBase | undefined;
export declare const createMapCustomControls: (mapRef: MapType, customControls: IAzureCustomControls[]) => void;
import { IAzureMapImageSprite, MapType } from '../../types';
export declare const createImageSprites: (mapRef: MapType, spriteArray: IAzureMapImageSprite[]) => Promise<void>;

@@ -0,0 +0,0 @@ import React from 'react';

import { IAzureMapFeature } from '../../types';
import atlas from 'azure-maps-control';
export declare const createAzureMapFeature: ({ type, coordinate, coordinates, multipleCoordinates, multipleDimensionCoordinates, bbox }: IAzureMapFeature) => atlas.data.Geometry | undefined;
import { DataSourceType, IAzureMapFeature, ShapeType, FeatureType } from '../../types';
export declare const useFeature: ({ setCoords, setProperties }: IAzureMapFeature, dataSourceRef: DataSourceType | null, shapeRef: ShapeType | null, featureRef: FeatureType | null) => void;

@@ -0,0 +0,0 @@ import React from 'react';

@@ -0,0 +0,0 @@ import atlas from 'azure-maps-control';

@@ -0,0 +0,0 @@ import atlas from 'azure-maps-control';

@@ -5,7 +5,7 @@ import React, { ReactElement } from 'react';

declare const AzureMapsConsumer: React.Consumer<import("../types").IAzureMapContextState>;
declare type IAzureMapsStatefulProviderProps = {
type IAzureMapsStatefulProviderProps = {
children?: ReactElement<IAzureMap>;
};
declare const AzureMapsStatefulProvider: ({ children }: IAzureMapsStatefulProviderProps) => JSX.Element;
declare const AzureMapsStatefulProvider: ({ children }: IAzureMapsStatefulProviderProps) => React.JSX.Element;
declare const useAzureMaps: () => import("../types").IAzureMapContextState;
export { AzureMapsConsumer, AzureMapsStatefulProvider as AzureMapsProvider, useAzureMaps };

@@ -13,3 +13,3 @@ import React from 'react';

*/
declare const AzureMapDataSourceStatefulProvider: ({ id, children, options, events, dataFromUrl, collection }: IAzureDataSourceStatefulProviderProps) => JSX.Element;
declare const AzureMapDataSourceStatefulProvider: ({ id, children, options, events, dataFromUrl, collection }: IAzureDataSourceStatefulProviderProps) => React.JSX.Element;
export { AzureMapDataSourceContext, AzureMapDataSourceConsumer, AzureMapDataSourceStatefulProvider as AzureMapDataSourceProvider, Provider as AzureMapDataSourceRawProvider };

@@ -5,3 +5,3 @@ import React from 'react';

declare const AzureMapLayerConsumer: React.Consumer<import("../types").IAzureMapLayerContextState>;
declare const AzureMapLayerStatefulProvider: ({ id, options, type, events, lifecycleEvents, onCreateCustomLayer }: IAzureLayerStatefulProviderProps) => JSX.Element;
declare const AzureMapLayerStatefulProvider: ({ id, options, type, events, lifecycleEvents, onCreateCustomLayer }: IAzureLayerStatefulProviderProps) => React.JSX.Element;
export { AzureMapLayerContext, AzureMapLayerConsumer, AzureMapLayerStatefulProvider as AzureMapLayerProvider };

@@ -0,1 +1,2 @@

import React from 'react';
import { IAzureVectorTileSourceStatefulProviderProps } from '../types';

@@ -8,3 +9,3 @@ /**

*/
declare const AzureMapVectorTileSourceStatefulProvider: ({ id, children, options, events }: IAzureVectorTileSourceStatefulProviderProps) => JSX.Element;
declare const AzureMapVectorTileSourceStatefulProvider: ({ id, children, options, events }: IAzureVectorTileSourceStatefulProviderProps) => React.JSX.Element;
export { AzureMapVectorTileSourceStatefulProvider as AzureMapVectorTileSourceProvider };

@@ -0,0 +0,0 @@ import { IAzureLayerStatefulProviderProps, LayerType, DataSourceType } from '../types';

export declare function useCheckRef<T, T1>(dep: T | null, on: T1 | null, callback: (dep: T, on: T1) => void): void;
export declare function useCheckRefMount<T, T1>(dep: T | null, on: T1 | null, callback: (dep: T, on: T1) => void): void;

@@ -0,0 +0,0 @@ export { default as AzureMap } from './components/AzureMap/AzureMap';

import { ComponentClass, CSSProperties, ReactElement, ReactNode, FunctionComponent } from 'react';
import atlas, { AnimationOptions, CameraBoundsOptions, CameraOptions, DataSourceOptions, HeatMapLayerOptions, HtmlMarker, HtmlMarkerEvents, HtmlMarkerOptions, ImageLayerOptions, LineLayerOptions, Map, MapDataEvent, MapErrorEvent, MapEvent, MapMouseEvent, MapMouseWheelEvent, MapTouchEvent, Options, PolygonExtrusionLayerOptions, PolygonLayerOptions, PopupEvents, PopupOptions, ServiceOptions, Shape, StyleOptions, SymbolLayerOptions, TargetedEvent, TileLayerOptions, TrafficOptions, UserInteractionOptions, Control, BubbleLayerOptions, LayerOptions, VectorTileSourceOptions } from 'azure-maps-control';
export declare type IAzureMapOptions = ServiceOptions & StyleOptions & UserInteractionOptions & (CameraOptions | CameraBoundsOptions);
export declare type IAzureMapChildren = ReactElement<IAzureMapHtmlMarker> | ReactElement<IAzureMapPopup> | ReactElement<IAzureMapDataSourceProps>;
export declare type IAzureMap = {
export type IAzureMapOptions = ServiceOptions & StyleOptions & UserInteractionOptions & (CameraOptions | CameraBoundsOptions);
export type IAzureMapChildren = ReactElement<IAzureMapHtmlMarker> | ReactElement<IAzureMapPopup> | ReactElement<IAzureMapDataSourceProps>;
export type IAzureMap = {
children?: Array<IAzureMapChildren> | IAzureMapChildren;

@@ -22,7 +22,7 @@ providedMapId?: string;

};
export declare type IAzureCustomControls = {
export type IAzureCustomControls = {
control: Control;
controlOptions?: ControlOptions;
};
export declare type IAzureMapControls = {
export type IAzureMapControls = {
controlName: string;

@@ -32,3 +32,3 @@ controlOptions?: Options;

};
export declare type IAzureMapImageSprite = {
export type IAzureMapImageSprite = {
id: string;

@@ -41,3 +41,3 @@ templateName?: string;

};
export declare type IAzureMapContextState = {
export type IAzureMapContextState = {
mapRef: Map | null;

@@ -49,14 +49,14 @@ isMapReady: boolean | false;

};
export declare type IAzureMapHtmlMarkerEvent = {
export type IAzureMapHtmlMarkerEvent = {
eventName: keyof HtmlMarkerEvents;
callback: (e: TargetedEvent) => void;
};
export declare type IAzureMapPopupEvent = {
export type IAzureMapPopupEvent = {
eventName: keyof PopupEvents;
callback: (e: TargetedEvent) => void;
};
export declare type IAzureMapMouseEvents = {
export type IAzureMapMouseEvents = {
[T in keyof HtmlMarkerEvents]: (e: TargetedEvent) => void;
};
export declare type IAzureMapHtmlMarker = {
export type IAzureMapHtmlMarker = {
id?: string;

@@ -68,3 +68,3 @@ isPopupVisible?: boolean;

};
export declare type IAzureMapPopup = {
export type IAzureMapPopup = {
isVisible?: boolean;

@@ -75,20 +75,20 @@ options?: PopupOptions;

};
export declare type IAzureMapDataSourceContextState = {
export type IAzureMapDataSourceContextState = {
dataSourceRef: atlas.source.DataSource | atlas.source.VectorTileSource | null;
};
export declare type IAzureMapLayerContextState = {
export type IAzureMapLayerContextState = {
layerRef: atlas.layer.SymbolLayer | atlas.layer.ImageLayer | atlas.layer.TileLayer | null;
};
export declare type IAzureDataSourceChildren = (IAzureMapFeature & ReactNode) | ReactElement<IAzureMapFeature> | ReactElement<IAzureLayerStatefulProviderProps>;
export declare type IAzureVectorTileSourceChildren = ReactElement<IAzureLayerStatefulProviderProps>;
export declare type IAzureMapDataSourceEvent = {
export type IAzureDataSourceChildren = (IAzureMapFeature & ReactNode) | ReactElement<IAzureMapFeature> | ReactElement<IAzureLayerStatefulProviderProps>;
export type IAzureVectorTileSourceChildren = ReactElement<IAzureLayerStatefulProviderProps>;
export type IAzureMapDataSourceEvent = {
[property in IAzureMapDataSourceEventType]: (e: Shape[]) => void;
};
export declare type IAzureMapVectorTileSourceEvent = {
export type IAzureMapVectorTileSourceEvent = {
[property in IAzureMapSourceEventType]?: (e: atlas.source.VectorTileSource) => void;
};
export declare type IAzureMapEvent = {
export type IAzureMapEvent = {
[property in IAzureMapEventsType]: (e: MapDataEvent | MapErrorEvent | MapTouchEvent | MapMouseEvent | string | MapMouseWheelEvent | MapEvent | atlas.layer.Layer | atlas.source.Source) => void;
};
export declare type IAzureDataSourceStatefulProviderProps = {
export type IAzureDataSourceStatefulProviderProps = {
id: string;

@@ -102,3 +102,3 @@ children?: Array<IAzureDataSourceChildren | IAzureDataSourceChildren[] | null> | IAzureDataSourceChildren | null;

};
export declare type IAzureVectorTileSourceStatefulProviderProps = {
export type IAzureVectorTileSourceStatefulProviderProps = {
id: string;

@@ -110,9 +110,9 @@ children?: Array<IAzureVectorTileSourceChildren | IAzureVectorTileSourceChildren[] | null> | IAzureVectorTileSourceChildren | null;

};
export declare type IAzureMapLayerEvent = {
export type IAzureMapLayerEvent = {
[property in IAzureMapLayerEventType]: (e: MapMouseEvent | MapTouchEvent | MapMouseWheelEvent) => void;
};
export declare type IAzureMapLifecycleEvent = {
export type IAzureMapLifecycleEvent = {
[property in IAzureMapLayerLifecycleEvents]: (e: atlas.layer.Layer) => void;
};
export declare type IAzureLayerStatefulProviderProps = {
export type IAzureLayerStatefulProviderProps = {
id?: string;

@@ -125,11 +125,11 @@ options?: (SymbolLayerOptions & HeatMapLayerOptions & ImageLayerOptions & LineLayerOptions & PolygonExtrusionLayerOptions & PolygonLayerOptions & TileLayerOptions & BubbleLayerOptions & LayerOptions) | Options;

};
export declare type IAzureMapLayerLifecycleEvents = 'layeradded' | 'layerremoved';
export declare type IAzureMapEventsType = IAzureMapLayerEventType | IAzureMapLayerLifecycleEvents | IAzureMapDataSourceEventType | IAzureMapAddEventsType | IAzureMapSourceEventType | 'data' | 'sourcedata' | 'styledata' | 'error' | 'styleimagemissing';
export declare type IAzureMapAddEventsType = 'boxzoomstart' | 'boxzoomend' | 'dragstart' | 'drag' | 'dragend' | 'idle' | 'load' | 'movestart' | 'move' | 'moveend' | 'pitchstart' | 'pitch' | 'pitchend' | 'ready' | 'render' | 'resize' | 'rotatestart' | 'rotate' | 'rotateend' | 'tokenacquired' | 'zoomstart' | 'zoom' | 'zoomend';
export declare type IAzureMapDataSourceEventType = 'dataadded' | 'dataremoved';
export declare type IAzureMapSourceEventType = 'sourceadded' | 'sourceremoved';
export declare type IAzureMapLayerEventType = 'mousedown' | 'mouseup' | 'mouseover' | 'mousemove' | 'click' | 'dblclick' | 'mouseout' | 'mouseenter' | 'mouseleave' | 'contextmenu' | 'wheel' | 'touchstart' | 'touchend' | 'touchmove' | 'touchcancel';
export declare type IAzureMapLayerType = 'SymbolLayer' | 'HeatLayer' | 'ImageLayer' | 'LineLayer' | 'PolygonExtrusionLayer' | 'PolygonLayer' | 'TileLayer' | 'BubbleLayer' | 'HtmlMarkerLayer' | 'custom';
export declare type IAzureMapFeatureType = 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon';
export declare type IAzureMapFeature = {
export type IAzureMapLayerLifecycleEvents = 'layeradded' | 'layerremoved';
export type IAzureMapEventsType = IAzureMapLayerEventType | IAzureMapLayerLifecycleEvents | IAzureMapDataSourceEventType | IAzureMapAddEventsType | IAzureMapSourceEventType | 'data' | 'sourcedata' | 'styledata' | 'error' | 'styleimagemissing';
export type IAzureMapAddEventsType = 'boxzoomstart' | 'boxzoomend' | 'dragstart' | 'drag' | 'dragend' | 'idle' | 'load' | 'movestart' | 'move' | 'moveend' | 'pitchstart' | 'pitch' | 'pitchend' | 'ready' | 'render' | 'resize' | 'rotatestart' | 'rotate' | 'rotateend' | 'tokenacquired' | 'zoomstart' | 'zoom' | 'zoomend';
export type IAzureMapDataSourceEventType = 'dataadded' | 'dataremoved';
export type IAzureMapSourceEventType = 'sourceadded' | 'sourceremoved';
export type IAzureMapLayerEventType = 'mousedown' | 'mouseup' | 'mouseover' | 'mousemove' | 'click' | 'dblclick' | 'mouseout' | 'mouseenter' | 'mouseleave' | 'contextmenu' | 'wheel' | 'touchstart' | 'touchend' | 'touchmove' | 'touchcancel';
export type IAzureMapLayerType = 'SymbolLayer' | 'HeatLayer' | 'ImageLayer' | 'LineLayer' | 'PolygonExtrusionLayer' | 'PolygonLayer' | 'TileLayer' | 'BubbleLayer' | 'HtmlMarkerLayer' | 'custom';
export type IAzureMapFeatureType = 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon';
export type IAzureMapFeature = {
id?: string;

@@ -147,17 +147,17 @@ type: IAzureMapFeatureType;

};
export declare type IAzureMapLayerProps = IAzureMapLayerContextState;
export declare type IAzureMapMouseEventRef = HtmlMarker;
export declare type IAzureMapsContextProps = IAzureMapContextState;
export declare type IAzureMapDataSourceProps = IAzureMapDataSourceContextState;
export declare type DataSourceType = atlas.source.DataSource | atlas.source.VectorTileSource;
export declare type LayerType = atlas.layer.SymbolLayer | atlas.layer.ImageLayer | atlas.layer.TileLayer;
export declare type MapType = atlas.Map;
export declare type GeometryType = atlas.data.Geometry;
export declare type FeatureType = atlas.data.Feature<atlas.data.Geometry, any>;
export declare type ShapeType = atlas.Shape;
export declare type IAzureMapFeatureVariant = 'shape' | 'feature';
export declare type AzureDataLineString = atlas.data.LineString;
export declare type AzureDataPosition = atlas.data.Position;
export declare type ControlOptions = atlas.ControlOptions;
export declare type AzureSetCameraOptions = ((CameraOptions | CameraBoundsOptions) & AnimationOptions) | any;
export type IAzureMapLayerProps = IAzureMapLayerContextState;
export type IAzureMapMouseEventRef = HtmlMarker;
export type IAzureMapsContextProps = IAzureMapContextState;
export type IAzureMapDataSourceProps = IAzureMapDataSourceContextState;
export type DataSourceType = atlas.source.DataSource | atlas.source.VectorTileSource;
export type LayerType = atlas.layer.SymbolLayer | atlas.layer.ImageLayer | atlas.layer.TileLayer;
export type MapType = atlas.Map;
export type GeometryType = atlas.data.Geometry;
export type FeatureType = atlas.data.Feature<atlas.data.Geometry, any>;
export type ShapeType = atlas.Shape;
export type IAzureMapFeatureVariant = 'shape' | 'feature';
export type AzureDataLineString = atlas.data.LineString;
export type AzureDataPosition = atlas.data.Position;
export type ControlOptions = atlas.ControlOptions;
export type AzureSetCameraOptions = ((CameraOptions | CameraBoundsOptions) & AnimationOptions) | any;
export { AuthenticationType } from 'azure-maps-control';
{
"name": "react-azure-maps",
"version": "1.0.0",
"version": "1.0.1",
"description": "React Wrapper for Azure Maps",

@@ -45,3 +45,3 @@ "keywords": [

"build:types": "tsc --emitDeclarationOnly",
"build": "yarn build:types && yarn build:code",
"build": "npm run build:types && npm run build:code",
"test": "jest --coverage --env=jsdom",

@@ -52,3 +52,3 @@ "test:watch": "jest --coverage --watch --env=jsdom",

"preview:react": "npx parcel preview/react-preview.html --out-dir preview-build --open --no-cache",
"dev": "concurrently 'yarn:dev:code' 'yarn:preview:react'"
"dev": "concurrently 'npm:dev:code' 'npm:preview:react'"
},

@@ -99,6 +99,7 @@ "husky": {

"@types/react-dom": "^18.0.6",
"azure-maps-control": "^3.0.1",
"azure-maps-control": "^3.0.3",
"babel-preset-env": "^1.7.0",
"concurrently": "^5.3.0",
"cross-env": "^7.0.2",
"deasync": "^0.1.30",
"eslint": "^7.14.0",

@@ -105,0 +106,0 @@ "husky": "^4.3.0",

@@ -46,3 +46,3 @@ # React-Azure-Maps

`React Azure Maps` have a fully documented [Playground Package](https://github.com/Azure/react-azure-maps-playground) that implements a lot of features from [Azure Maps Code Samples](https://azuremapscodesamples.azurewebsites.net/). If you implement new usage of the map and want to be contributor just create a PR.
`React Azure Maps` have a fully documented [Playground Package](https://github.com/Azure/react-azure-maps-playground) that implements a lot of features from [Azure Maps Code Samples](https://samples.azuremaps.com/). If you implement new usage of the map and want to be contributor just create a PR.

@@ -49,0 +49,0 @@ ## Library Implementation Details

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc