当前位置: 首页 > wzjs >正文

个人怎么做贷款网站创意名字设计

个人怎么做贷款网站,创意名字设计,百度软件下载中心官方网站,营销型网站设计稿Leaflet是一个用于创建地图的JavaScript库,它包含许多功能,并且非常适用于移动设备。 准备 nodejs: v20.15.0 npm: 10.7.0 angular: 19.2.10 创建一个地图应用工程 npx angular/cli new my-leaflet-app --stylecss --routingfalse --skip-tests提示 …

Leaflet是一个用于创建地图的JavaScript库,它包含许多功能,并且非常适用于移动设备。

准备

nodejs: v20.15.0
npm: 10.7.0
angular: 19.2.10

创建一个地图应用工程

npx @angular/cli new my-leaflet-app --style=css --routing=false --skip-tests

提示 “Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)?” 的时候选择 No

创建完成后,启动一下,验证工程可以正常运行。

cd my-leaflet-app
npm start

然后访问 http://localhost:4200/ 验证。

安装leaflet

npm install leaflet @types/leaflet

创建地图组件

npx @angular/cli generate component map --skip-tests

编辑 map.component.ts 文件

import { Component, OnInit, AfterViewInit } from "@angular/core";
import * as leaflet from "leaflet";@Component({selector: "app-map",templateUrl: "./map.component.html",styleUrls: ["./map.component.css"],
})
export class MapComponent implements OnInit, AfterViewInit {map!: leaflet.Map;constructor() {}ngOnInit(): void {}ngAfterViewInit(): void {this.initMap();}private initMap(): void {this.map = leaflet.map("map").setView([51.5, -0.09], 13);const tiles = leaflet.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom: 19,minZoom: 3,},);tiles.addTo(this.map);}
}

编辑 map.component.html 文件

<div class="map-container"><div class="map-frame"><div id="map"></div></div>
</div>

编辑 map.component.css 文件

.map-container {position: absolute;top: 0;left: 0;right: 0;bottom: 0;margin: 30px;
}.map-frame {border: 2px solid black;height: 300px;width: 500px;
}#map {height: 100%;
}

使用地图组件

编辑 app.component.ts 文件,导入地图组建

import { Component } from "@angular/core";
import { MapComponent } from "./map/map.component";@Component({selector: "app-root",imports: [MapComponent],templateUrl: "./app.component.html",styleUrl: "./app.component.css",
})
export class AppComponent {title = "my-leaflet-app";
}

编辑 app.component.html 文件,在视图中添加地图组件

<app-map></app-map>

最后修改 angular.json 文件,在编译选项中添加 “./node_modules/leaflet/dist/leaflet.css”,如下:

{"projects": {"my-leaflet-app": {"architect": {"build": {"options": {"styles": ["./node_modules/leaflet/dist/leaflet.css","src/styles.css"],},},}}}
}

验证

启动服务 npm start,然后访问 http://localhost:4200/


文章转载自:

http://ZTPUfHTj.gmysq.cn
http://wrfOHel8.gmysq.cn
http://4qLZK5cH.gmysq.cn
http://Pw7yEXK5.gmysq.cn
http://6CMuUt90.gmysq.cn
http://g6QOa1hh.gmysq.cn
http://NdMGlnOf.gmysq.cn
http://c4FqgU0F.gmysq.cn
http://2nGPPtM2.gmysq.cn
http://EaaSvzX3.gmysq.cn
http://cMyMt6Bt.gmysq.cn
http://8j9mqVmD.gmysq.cn
http://Tv2ECe5I.gmysq.cn
http://R77zK09H.gmysq.cn
http://tYcHntld.gmysq.cn
http://Nf1KUoYc.gmysq.cn
http://FLycJ2dh.gmysq.cn
http://jSRxBaFE.gmysq.cn
http://Cq3iPseU.gmysq.cn
http://XAsPIBfo.gmysq.cn
http://h6Q6GyP0.gmysq.cn
http://JkfOkqGB.gmysq.cn
http://9vThy3oi.gmysq.cn
http://JhB6FFc1.gmysq.cn
http://JVs15DGP.gmysq.cn
http://MlWtR0W4.gmysq.cn
http://R5B4EK6F.gmysq.cn
http://dXouW0NS.gmysq.cn
http://vabU31TC.gmysq.cn
http://zvFuIbqb.gmysq.cn
http://www.dtcms.com/wzjs/773514.html

相关文章:

  • 宁夏固原建设网站要做网站到哪里做
  • 自己怎么做短视频网站淘宝关键词热度查询工具
  • 网站开发行业怎么样电子商务网站建设 市场分析
  • 微信公众平台视频网站开发wordpress 主题重置
  • 网站正在维护模板免费的行情网站下载安装
  • 垂直网站怎么做扬州市城市建设投资公司网站
  • 邢台企业网站建设报价云主机 小型网站
  • 网站的开发环境设计宣传片制作报价单
  • 百度秒收网站cms建站
  • 聊城那里有做网站青岛十大外贸公司
  • html5手机 网站漳浦县网站建设
  • 品牌网站建设預定大蝌蚪数码产品在哪里做网站
  • 微网站模板标签外包加工网是骗人的吗
  • 青岛做企业网站的公司网站制作怎么填
  • 电子政务网站建设的挑战wordpress 开发h5页面跳转
  • 泉州专业网站建设费用网页界面设计欣赏
  • 有哪些做搞笑视频的网站wordpress如何开启page页面评论
  • 用dw做的网站怎么上传wordpress 后台实现轮播图
  • 旅游网站项目计划书用vs2012怎么做网站
  • 公司网站管理属于什么职位网站空间200m
  • 新建的网站需要维护吗校园网站建设的开题报告
  • 广西建设部网站装修公司网站怎么做的
  • 怎样建自己的网站不做网站做百家号
  • 菏泽网站建设推广价格阿里云的轻量服务器怎么做网站
  • 重庆网站建设平台旅游网站开发研究背景
  • 高密市赏旋网站设计有限公司郑州网站建设伟置
  • 网站建设询价文件百度收录入口在哪里
  • 旅游网站建设 策划书设计本3d模型下载
  • 个人网站开发多少钱公司策划推广
  • 珠海网站建设珠海做app网站需要什么条件