2017-05-05 13 views
0

私はASPXプロジェクトを作成しました。チラシマップを統合したいと思います。リーフレット地図をaspxで使用するには?

HTMLページを使用する前にリーフレットを使用しましたが、現在ASPXではすべてを<asp:content>タグ内に入れる必要があります。

マイコード

<asp:Content ID="MapPage" ContentPlaceHolderID="MainContent" runat="server"> 
    <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" 
    integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ==" 
    crossorigin=""/> 

    <script src="https://unpkg.com/[email protected]/dist/leaflet.js" 
    integrity="sha512-A7vV8IFfih/D732iSSKi20u/ooOfj/AGehOKq0f4vLT1Zr2Y+RX7C+w8A1gaSasGtRUZpF/NZgzSAu4/Gc41Lg==" 
    crossorigin=""></script> 


    <div id="mapid" style="height:100px; width:100px;"></div> 

</asp:Content> 

私はまた、VS17はHTML5がcrossoriginintegrityフィールド...いずれかを認識していないと言う... http://leafletjs.com/examples/quick-start/

自分のチュートリアルからのリンクやスクリプトタグを取りました提案?

答えて

0

これを試してください、これは私のために働くことができますか?

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" 
AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" 
Inherits="WebApplication1.WebForm3" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" 
runat="server"> 

<meta charset="utf-8" /> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 

<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" /> 

    <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ==" crossorigin=""/> 
    <script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-A7vV8IFfih/D732iSSKi20u/ooOfj/AGehOKq0f4vLT1Zr2Y+RX7C+w8A1gaSasGtRUZpF/NZgzSAu4/Gc41Lg==" crossorigin=""></script> 




<body> 



<div id="mapid" style="width: 600px; height: 400px;"></div> 
<script> 

var mymap = L.map('mapid').setView([51.505, -0.09], 13); 

L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', { 
    maxZoom: 18, 
    attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + 
     '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + 
     'Imagery © <a href="http://mapbox.com">Mapbox</a>', 
    id: 'mapbox.streets' 
}).addTo(mymap); 

関連する問題