7373 < ul >
7474 < li data-name ="epsglookupmaptiler "> < a href ="module-ol_proj_proj4.html#.epsgLookupMapTiler "> epsgLookupMapTiler</ a >
7575 < li data-name ="fromepsgcode "> < a href ="module-ol_proj_proj4.html#.fromEPSGCode "> fromEPSGCode</ a >
76+ < li data-name ="fromprojectioncode "> < a href ="module-ol_proj_proj4.html#.fromProjectionCode "> fromProjectionCode</ a >
7677 < li data-name ="register "> < a href ="module-ol_proj_proj4.html#.register "> register</ a >
7778 < li data-name ="setepsglookup "> < a href ="module-ol_proj_proj4.html#.setEPSGLookup "> setEPSGLookup</ a >
79+ < li data-name ="setprojectioncodelookup "> < a href ="module-ol_proj_proj4.html#.setProjectionCodeLookup "> setProjectionCodeLookup</ a >
7880 </ ul >
7981 </ div >
8082 < li class ="loading "> Loading …
@@ -183,7 +185,7 @@ <h4 class="name">
183185
184186 < div class ="tag-source ">
185187 < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js "> proj/proj4.js</ a > ,
186- < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js#L170 "> line 170 </ a >
188+ < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js#L231 "> line 231 </ a >
187189 </ div >
188190
189191 </ div >
@@ -268,6 +270,8 @@ <h4 class="name">
268270
269271
270272
273+ < dt class ="important tag-deprecated "> Deprecated</ dt > < dd > < ul class ="dummy "> < li > Not needed any more, the default lookup provides this functionality now.</ li > < ul > </ dd >
274+
271275
272276
273277
@@ -324,7 +328,7 @@ <h4 class="name">
324328
325329 < div class ="tag-source ">
326330 < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js "> proj/proj4.js</ a > ,
327- < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js#L139 "> line 139 </ a >
331+ < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js#L213 "> line 213 </ a >
328332 </ div >
329333
330334 </ div >
@@ -341,9 +345,10 @@ <h4 class="name">
341345
342346 < div class ="description ">
343347 < p > Get a projection from an EPSG code. This function fetches the projection
344- definition from the epsg.io website, registers this definition for use with
345- proj4, and returns a configured projection. You must call import proj4 and
346- call < a href ="module-ol_proj_proj4.html#.register "> < code > register</ code > </ a > before using this function.</ p >
348+ definition from the spatialreference.org website, registers this definition
349+ for use with proj4, and returns a configured projection. You must call
350+ import proj4 and call < a href ="module-ol_proj_proj4.html#.register "> < code > register</ code > </ a > before using this
351+ function.</ p >
347352< p > If the projection definition is already registered with proj4, it will not
348353be fetched again (so it is ok to call this function multiple times with the
349354same code).</ p >
@@ -415,6 +420,153 @@ <h4 class="name">
415420
416421
417422
423+ < dt class ="important tag-deprecated "> Deprecated</ dt > < dd > < ul class ="dummy "> < li > Use < a href ="module-ol_proj_proj4.html#.fromProjectionCode "> < code > fromProjectionCode</ code > </ a > instead.</ li > < ul > </ dd >
424+
425+
426+
427+
428+
429+
430+
431+
432+
433+
434+
435+
436+
437+
438+
439+ </ dl >
440+
441+
442+
443+
444+
445+
446+
447+
448+
449+
450+
451+
452+
453+
454+
455+ < h5 > Returns:</ h5 >
456+ The projection.
457+ < br />
458+
459+
460+
461+
462+ </ dd >
463+
464+
465+
466+
467+ < dt class ="">
468+
469+ < div class ="nameContainer ">
470+ < div class ="anchor " id =".fromProjectionCode ">
471+ </ div >
472+ < h4 class ="name ">
473+ fromProjectionCode< span class ="signature "> (code)</ span > < span class ="fa fa-arrow-circle-right "> </ span > < span class ="type-signature returnType "> {Promise<< a href ="module-ol_proj_Projection-Projection.html "> Projection</ a > > }</ span >
474+
475+
476+
477+ </ h4 >
478+
479+ < div class ="tag-source ">
480+ < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js "> proj/proj4.js</ a > ,
481+ < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js#L148 "> line 148</ a >
482+ </ div >
483+
484+ </ div >
485+
486+
487+ </ dt >
488+ < dd class ="">
489+
490+
491+
492+ < pre class ="prettyprint source "> < code > import {fromProjectionCode} from 'ol/proj/proj4';</ code > </ pre >
493+
494+
495+
496+ < div class ="description ">
497+ < p > Get a projection from a projection code (i.e., authority:number).
498+ This function fetches the projection definition from the
499+ < a href ="https://spatialreference.org "> https://spatialreference.org</ a > website, registers this definition for use with
500+ proj4, and returns a configured projection. You must call import proj4 and
501+ call < a href ="module-ol_proj_proj4.html#.register "> < code > register</ code > </ a > before using this function.</ p >
502+ < p > If the projection definition is already registered with proj4, it will not
503+ be fetched again (so it is ok to call this function multiple times with the
504+ same code).</ p >
505+ </ div >
506+
507+
508+
509+
510+
511+
512+
513+
514+
515+
516+ < table class ="params ">
517+ < thead >
518+ < tr >
519+
520+ < th > Name</ th >
521+
522+
523+ < th > Type</ th >
524+
525+ < th class ="last "> Description</ th >
526+ </ tr >
527+ </ thead >
528+
529+ < tbody >
530+
531+
532+ < tr class ="">
533+
534+ < td class ="name "> < code > code</ code > </ td >
535+
536+
537+
538+ < td class ="type ">
539+
540+
541+ < span class ="param-type "> string</ span >
542+
543+
544+
545+
546+ </ td >
547+
548+
549+
550+ < td class ="description last ">
551+
552+ < p > The projection code (e.g., 'EPSG:4326' or 'OGC:CRS84').</ p > </ td >
553+ </ tr >
554+
555+
556+ </ tbody >
557+ </ table >
558+
559+
560+
561+
562+ < dl class ="details ">
563+
564+
565+
566+
567+
568+
569+
418570
419571
420572
@@ -604,7 +756,7 @@ <h4 class="name">
604756
605757 < div class ="tag-source ">
606758 < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js "> proj/proj4.js</ a > ,
607- < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js#L112 "> line 112 </ a >
759+ < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js#L183 "> line 183 </ a >
608760 </ div >
609761
610762 </ div >
@@ -620,10 +772,144 @@ <h4 class="name">
620772
621773
622774 < div class ="description ">
623- < p > Set the lookup function for getting proj4 definitions given an EPSG code.
775+ < p > Set the lookup function for getting proj4 or WKT definitions given an EPSG code.
624776By default, the < a href ="module-ol_proj_proj4.html#.fromEPSGCode "> < code > fromEPSGCode</ code > </ a > function uses the
625- epsg.io website for proj4 definitions. This can be changed by providing a
626- different lookup function.</ p >
777+ spatialreference.org website for WKT definitions.
778+ This can be changed by providing a different lookup function.</ p >
779+ </ div >
780+
781+
782+
783+
784+
785+
786+
787+
788+
789+
790+ < table class ="params ">
791+ < thead >
792+ < tr >
793+
794+ < th > Name</ th >
795+
796+
797+ < th > Type</ th >
798+
799+ < th class ="last "> Description</ th >
800+ </ tr >
801+ </ thead >
802+
803+ < tbody >
804+
805+
806+ < tr class ="">
807+
808+ < td class ="name "> < code > func</ code > </ td >
809+
810+
811+
812+ < td class ="type ">
813+
814+
815+ < span class ="param-type "> function</ span >
816+
817+
818+
819+
820+ </ td >
821+
822+
823+
824+ < td class ="description last ">
825+
826+ < p > The lookup function.</ p > </ td >
827+ </ tr >
828+
829+
830+ </ tbody >
831+ </ table >
832+
833+
834+
835+
836+ < dl class ="details ">
837+
838+
839+
840+
841+
842+
843+
844+ < dt class ="important tag-deprecated "> Deprecated</ dt > < dd > < ul class ="dummy "> < li > Use < a href ="module-ol_proj_proj4.html#.setProjectionCodeLookup "> < code > setProjectionCodeLookup</ code > </ a > instead.</ li > < ul > </ dd >
845+
846+
847+
848+
849+
850+
851+
852+
853+
854+
855+
856+
857+
858+
859+
860+ </ dl >
861+
862+
863+
864+
865+
866+
867+
868+
869+
870+
871+
872+
873+
874+ </ dd >
875+
876+
877+
878+
879+ < dt class ="">
880+
881+ < div class ="nameContainer ">
882+ < div class ="anchor " id =".setProjectionCodeLookup ">
883+ </ div >
884+ < h4 class ="name ">
885+ setProjectionCodeLookup< span class ="signature "> (func)</ span >
886+
887+
888+
889+ </ h4 >
890+
891+ < div class ="tag-source ">
892+ < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js "> proj/proj4.js</ a > ,
893+ < a href ="https://github.com/openlayers/openlayers/blob/main/src/ol/proj/proj4.js#L120 "> line 120</ a >
894+ </ div >
895+
896+ </ div >
897+
898+
899+ </ dt >
900+ < dd class ="">
901+
902+
903+
904+ < pre class ="prettyprint source "> < code > import {setProjectionCodeLookup} from 'ol/proj/proj4';</ code > </ pre >
905+
906+
907+
908+ < div class ="description ">
909+ < p > Set the lookup function for getting proj4 or WKT definitions given an
910+ projection code. By default, the < a href ="module-ol_proj_proj4.html#.fromProjectionCode "> < code > fromProjectionCode</ code > </ a >
911+ function uses the spatialreference.org website for WKT definitions.
912+ This can be changed by providing a different lookup function.</ p >
627913 </ div >
628914
629915
0 commit comments