JSFiddle - React, Tailwind, and code Playground
by HYEONGJINKIM
HTML
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Mobile Popup</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css">
<style>
html, body, #map{
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script src="http://js.arcgis.com/3.7/"></script>
<script>
require([
"esri/map",
"esri/dijit/PopupMobile",
"esri/graphic",
"esri/InfoTemplate",
"esri/geometry/Point",
"esri/symbols/SimpleMarkerSymbol",
"dojo/_base/Color",
"dojo/domReady!"
], function(
Map,
PopupMobile,
Graphic,
InfoTemplate,
Point,
SimpleMarkerSymbol,
Color
){
var mobilePopup = new PopupMobile(null, dojo.create("div"));
var map = new Map("map", {
basemap: "satellite",
center: [-116.96, 33.184],
zoom: 7,
infoWindow: mobilePopup
});
map.on("load", function(){
map.infoWindow.resize(250,100);
});
map.on("click", addPoint);
function addPoint(evt) {
//clear any existing graphics
map.graphics.clear();
var geometry = new Point(evt.mapPoint);
//Define the attributes that will show up in the popup window. In this example we'll just display
//the latitude and longitude.
var attributes = {"latitude":evt.mapPoint.getLatitude(),"longitude":evt.mapPoint.getLongitude()};
//Define the template for an info window that specifies the title and content
var template...